All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.snapscript.parse.SyntaxNodeComparator Maven / Gradle / Ivy

package org.snapscript.parse;

import java.util.Comparator;

public class SyntaxNodeComparator implements Comparator {
   
   public SyntaxNodeComparator() {
      super();
   }

   @Override
   public int compare(SyntaxNode left, SyntaxNode right) {
      int leftMark = left.getStart();
      int rightMark = right.getStart();
      
      if(leftMark < rightMark) {
         return -1;
      }
      if(leftMark == rightMark) {
         return 0;
      }
      return 1; 
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy