@Override public void actionInAlt(ActionAST action) { if (inFragmentRule) { String fileName = action.token.getInputStream().getSourceName(); String ruleName = currentRuleName; g.tool.errMgr.grammarError(ErrorType.FRAGMENT_ACTION_IGNORED, fileName, action.token, ruleName); } }
@Override public void actionInAlt(ActionAST action) { if (inFragmentRule) { String fileName = action.token.getInputStream().getSourceName(); String ruleName = currentRuleName; g.tool.errMgr.grammarError(ErrorType.FRAGMENT_ACTION_IGNORED, fileName, action.token, ruleName); } }
/** Consume if {@code x} is next character on the input stream. */ public void match(char x) { if ( c != x ) { NoViableAltException e = new NoViableAltException("",0,0,input); errMgr.lexerError(input.getSourceName(), "expecting '"+x+"', found '"+str(c)+"'", templateToken, e); } consume(); }
/** Ensure x is next character on the input stream */ public void match(char x) { if ( c != x ) { NoViableAltException e = new NoViableAltException("",0,0,input); errMgr.lexerError(input.getSourceName(), "expecting '"+x+"', found '"+str(c)+"'", templateToken, e); } consume(); }
/** Consume if {@code x} is next character on the input stream. */ public void match(char x) { if ( c != x ) { NoViableAltException e = new NoViableAltException("",0,0,input); errMgr.lexerError(input.getSourceName(), "expecting '"+x+"', found '"+str(c)+"'", templateToken, e); } consume(); }
@Override protected void enterLexerCommand(GrammarAST tree) { checkElementIsOuterMostInSingleAlt(tree); if (inFragmentRule) { String fileName = tree.token.getInputStream().getSourceName(); String ruleName = currentRuleName; g.tool.errMgr.grammarError(ErrorType.FRAGMENT_ACTION_IGNORED, fileName, tree.token, ruleName); } }
void checkInvalidRuleRef(Token ruleID) { String fileName = ruleID.getInputStream().getSourceName(); if ( g.isLexer() && Character.isLowerCase(ruleID.getText().charAt(0)) ) { g.tool.errMgr.grammarError(ErrorType.PARSER_RULE_REF_IN_LEXER_RULE, fileName, ruleID, ruleID.getText(), currentRuleName); } }
public void compileTimeError(ErrorType error, Token templateToken, Token t, Object arg, Object arg2) { String srcName = t.getInputStream().getSourceName(); if ( srcName!=null ) srcName = Misc.getFileName(srcName); listener.compileTimeError( new STCompiletimeMessage(error,srcName,templateToken,t,null,arg,arg2) ); }
public void compileTimeError(ErrorType error, Token templateToken, Token t, Object arg) { String srcName = t.getInputStream().getSourceName(); if ( srcName!=null ) srcName = Misc.getFileName(srcName); listener.compileTimeError( new STCompiletimeMessage(error,srcName,templateToken,t,null,arg) ); }
public void compileTimeError(ErrorType error, Token templateToken, Token t, Object arg, Object arg2) { String srcName = t.getInputStream().getSourceName(); if ( srcName!=null ) srcName = Misc.getFileName(srcName); listener.compileTimeError( new STCompiletimeMessage(error,srcName,templateToken,t,null,arg,arg2) ); }
public void compileTimeError(ErrorType error, Token templateToken, Token t, Object arg) { String srcName = t.getInputStream().getSourceName(); if ( srcName!=null ) srcName = Misc.getFileName(srcName); listener.compileTimeError( new STCompiletimeMessage(error,srcName,templateToken,t,null,arg) ); }
public void compileTimeError(ErrorType error, Token templateToken, Token t, Object arg, Object arg2) { String srcName = t.getInputStream().getSourceName(); if ( srcName!=null ) srcName = Misc.getFileName(srcName); listener.compileTimeError( new STCompiletimeMessage(error,srcName,templateToken,t,null,arg,arg2) ); }
public void compileTimeError(ErrorType error, Token templateToken, Token t, Object arg, Object arg2) { String srcName = t.getInputStream().getSourceName(); if ( srcName!=null ) srcName = Misc.getFileName(srcName); listener.compileTimeError( new STCompiletimeMessage(error,srcName,templateToken,t,null,arg,arg2) ); }
public void compileTimeError(ErrorType error, Token templateToken, Token t, Object arg) { String srcName = t.getInputStream().getSourceName(); if ( srcName!=null ) srcName = Misc.getFileName(srcName); listener.compileTimeError( new STCompiletimeMessage(error,srcName,templateToken,t,null,arg) ); }
public void compileTimeError(ErrorType error, Token templateToken, Token t, Object arg) { String srcName = t.getInputStream().getSourceName(); if ( srcName!=null ) srcName = Misc.getFileName(srcName); listener.compileTimeError( new STCompiletimeMessage(error,srcName,templateToken,t,null,arg) ); }
public void compileTimeError(ErrorType error, Token templateToken, Token t, Object arg) { String srcName = t.getInputStream().getSourceName(); if ( srcName!=null ) srcName = Misc.getFileName(srcName); listener.compileTimeError( new STCompiletimeMessage(error,srcName,templateToken,t,null,arg) ); }
public void compileTimeError(ErrorType error, Token templateToken, Token t) { CharStream input = t.getInputStream(); String srcName = null; if ( input!=null ) { srcName = input.getSourceName(); if ( srcName!=null ) srcName = Misc.getFileName(srcName); } listener.compileTimeError( new STCompiletimeMessage(error,srcName,templateToken,t,null,t.getText()) ); }
public void compileTimeError(ErrorType error, Token templateToken, Token t) { CharStream input = t.getInputStream(); String srcName = null; if ( input!=null ) { srcName = input.getSourceName(); if ( srcName!=null ) srcName = Misc.getFileName(srcName); } listener.compileTimeError( new STCompiletimeMessage(error,srcName,templateToken,t,null,t.getText()) ); }
void checkTokenDefinition(Token tokenID) { String fileName = tokenID.getInputStream().getSourceName(); if ( !Grammar.isTokenName(tokenID.getText()) ) { g.tool.errMgr.grammarError(ErrorType.TOKEN_NAMES_MUST_START_UPPER, fileName, tokenID, tokenID.getText()); } }
public void compileTimeError(ErrorType error, Token templateToken, Token t) { String srcName = t.getInputStream().getSourceName(); if ( srcName!=null ) srcName = Misc.getFileName(srcName); listener.compileTimeError( new STCompiletimeMessage(error,srcName,templateToken,t,null,t.getText()) ); }