@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); } }
public GrammarAST dupTree() { GrammarAST t = this; CharStream input = this.token.getInputStream(); GrammarASTAdaptor adaptor = new GrammarASTAdaptor(input); return (GrammarAST)adaptor.dupTree(t); }
@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); } }
@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); } }
@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); } }
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, 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, 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) { 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()) ); }
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()) ); }
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) { 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()) ); }
@Override public void displayRecognitionError(String[] tokenNames, RecognitionException e) { Token tokenWithPosition = e.token; if (tokenWithPosition.getInputStream() == null) { tokenWithPosition = input.getTreeAdaptor().getToken(input.LT(-1)); } String hdr = getErrorHeader(e); String msg = getErrorMessage(e, tokenNames); errMgr.compileTimeError(ErrorType.SYNTAX_ERROR, templateToken, tokenWithPosition, hdr + " " + msg); }