001: package antlr;
002:
003: /* ANTLR Translator Generator
004: * Project led by Terence Parr at http://www.cs.usfca.edu
005: * Software rights: http://www.antlr.org/license.html
006: */
007:
008: import antlr.collections.impl.BitSet;
009:
010: public interface ANTLRGrammarParseBehavior {
011: public void abortGrammar();
012:
013: public void beginAlt(boolean doAST_);
014:
015: public void beginChildList();
016:
017: // Exception handling
018: public void beginExceptionGroup();
019:
020: public void beginExceptionSpec(Token label);
021:
022: public void beginSubRule(Token label, Token start, boolean not);
023:
024: // Trees
025: public void beginTree(Token tok) throws SemanticException;
026:
027: public void defineRuleName(Token r, String access, boolean ruleAST,
028: String docComment) throws SemanticException;
029:
030: public void defineToken(Token tokname, Token tokliteral);
031:
032: public void endAlt();
033:
034: public void endChildList();
035:
036: public void endExceptionGroup();
037:
038: public void endExceptionSpec();
039:
040: public void endGrammar();
041:
042: public void endOptions();
043:
044: public void endRule(String r);
045:
046: public void endSubRule();
047:
048: public void endTree();
049:
050: public void hasError();
051:
052: public void noASTSubRule();
053:
054: public void oneOrMoreSubRule();
055:
056: public void optionalSubRule();
057:
058: public void refAction(Token action);
059:
060: public void refArgAction(Token action);
061:
062: public void setUserExceptions(String thr);
063:
064: public void refCharLiteral(Token lit, Token label,
065: boolean inverted, int autoGenType, boolean lastInRule);
066:
067: public void refCharRange(Token t1, Token t2, Token label,
068: int autoGenType, boolean lastInRule);
069:
070: public void refElementOption(Token option, Token value);
071:
072: public void refTokensSpecElementOption(Token tok, Token option,
073: Token value);
074:
075: public void refExceptionHandler(Token exTypeAndName, Token action);
076:
077: public void refHeaderAction(Token name, Token act);
078:
079: public void refInitAction(Token action);
080:
081: public void refMemberAction(Token act);
082:
083: public void refPreambleAction(Token act);
084:
085: public void refReturnAction(Token returnAction);
086:
087: public void refRule(Token idAssign, Token r, Token label,
088: Token arg, int autoGenType);
089:
090: public void refSemPred(Token pred);
091:
092: public void refStringLiteral(Token lit, Token label,
093: int autoGenType, boolean lastInRule);
094:
095: public void refToken(Token assignId, Token t, Token label,
096: Token args, boolean inverted, int autoGenType,
097: boolean lastInRule);
098:
099: public void refTokenRange(Token t1, Token t2, Token label,
100: int autoGenType, boolean lastInRule);
101:
102: // Tree specifiers
103: public void refTreeSpecifier(Token treeSpec);
104:
105: public void refWildcard(Token t, Token label, int autoGenType);
106:
107: public void setArgOfRuleRef(Token argaction);
108:
109: public void setCharVocabulary(BitSet b);
110:
111: // Options
112: public void setFileOption(Token key, Token value, String filename);
113:
114: public void setGrammarOption(Token key, Token value);
115:
116: public void setRuleOption(Token key, Token value);
117:
118: public void setSubruleOption(Token key, Token value);
119:
120: public void startLexer(String file, Token name, String super Class,
121: String doc);
122:
123: // Flow control for grammars
124: public void startParser(String file, Token name, String super Class,
125: String doc);
126:
127: public void startTreeWalker(String file, Token name,
128: String super Class, String doc);
129:
130: public void synPred();
131:
132: public void zeroOrMoreSubRule();
133: }
|