package org.simantics.scl.compiler.internal.parsing.parser;
+import org.simantics.scl.compiler.compilation.CompilationContext;
import org.simantics.scl.compiler.internal.parsing.Token;
import org.simantics.scl.compiler.errors.Locations;
import org.simantics.scl.compiler.internal.parsing.exceptions.SCLSyntaxErrorException;
/**
* This class is a scanner generated by
* <a href="http://www.jflex.de/">JFlex</a> 1.6.1
- * from the specification file <tt>C:/GamsGui/git/platform/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLLexer.flex</tt>
+ * from the specification file <tt>C:/Simugawa.git/git/platform/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLLexer.flex</tt>
*/
public class SCLLexer {
TIntArrayList stateStack = new TIntArrayList(2);
StringBuffer string = new StringBuffer();
+ CompilationContext context;
private Token sym(int id) {
return new Token(id, yychar, yychar+yylength(), yytext());
private Token sym(int id, String text) {
return new Token(id, yychar, yychar+yylength(), text);
}
+ public void setCompilationContext(CompilationContext context) {
+ this.context = context;
+ }
+ public boolean supportCHR() {
+ return context.header == null ? false : context.header.chr;
+ }
/**
}
case 157: break;
case 63:
- { return sym(SCLTerminals.RULE);
+ { return sym(supportCHR() ? SCLTerminals.ID : SCLTerminals.RULE);
}
case 158: break;
case 64:
}
case 177: break;
case 83:
- { return sym(SCLTerminals.RULESET);
+ { return sym(supportCHR() ? SCLTerminals.RULESET : SCLTerminals.ID);
}
case 178: break;
case 84:
}
case 187: break;
case 93:
- { return sym(SCLTerminals.TRANSFORMATION);
+ { return sym(supportCHR() ? SCLTerminals.ID : SCLTerminals.TRANSFORMATION);
}
case 188: break;
case 94: