diff --git a/org/antlr/Tool.class b/org/antlr/Tool.class deleted file mode 100644 index 4c207ad..0000000 Binary files a/org/antlr/Tool.class and /dev/null differ diff --git a/org/antlr/analysis/ActionLabel.class b/org/antlr/analysis/ActionLabel.class deleted file mode 100644 index 3ab83ef..0000000 Binary files a/org/antlr/analysis/ActionLabel.class and /dev/null differ diff --git a/org/antlr/analysis/AnalysisRecursionOverflowException.class b/org/antlr/analysis/AnalysisRecursionOverflowException.class deleted file mode 100644 index e7995ba..0000000 Binary files a/org/antlr/analysis/AnalysisRecursionOverflowException.class and /dev/null differ diff --git a/org/antlr/analysis/AnalysisTimeoutException.class b/org/antlr/analysis/AnalysisTimeoutException.class deleted file mode 100644 index 43c4fe9..0000000 Binary files a/org/antlr/analysis/AnalysisTimeoutException.class and /dev/null differ diff --git a/org/antlr/analysis/DFA.class b/org/antlr/analysis/DFA.class deleted file mode 100644 index 917cf48..0000000 Binary files a/org/antlr/analysis/DFA.class and /dev/null differ diff --git a/org/antlr/analysis/DFAOptimizer.class b/org/antlr/analysis/DFAOptimizer.class deleted file mode 100644 index 0f8e148..0000000 Binary files a/org/antlr/analysis/DFAOptimizer.class and /dev/null differ diff --git a/org/antlr/analysis/DFAState.class b/org/antlr/analysis/DFAState.class deleted file mode 100644 index bff0568..0000000 Binary files a/org/antlr/analysis/DFAState.class and /dev/null differ diff --git a/org/antlr/analysis/DecisionProbe.class b/org/antlr/analysis/DecisionProbe.class deleted file mode 100644 index 02374f8..0000000 Binary files a/org/antlr/analysis/DecisionProbe.class and /dev/null differ diff --git a/org/antlr/analysis/LL1Analyzer.class b/org/antlr/analysis/LL1Analyzer.class deleted file mode 100644 index dc45eda..0000000 Binary files a/org/antlr/analysis/LL1Analyzer.class and /dev/null differ diff --git a/org/antlr/analysis/LL1DFA.class b/org/antlr/analysis/LL1DFA.class deleted file mode 100644 index a4110ef..0000000 Binary files a/org/antlr/analysis/LL1DFA.class and /dev/null differ diff --git a/org/antlr/analysis/Label.class b/org/antlr/analysis/Label.class deleted file mode 100644 index 09e9fd5..0000000 Binary files a/org/antlr/analysis/Label.class and /dev/null differ diff --git a/org/antlr/analysis/LookaheadSet.class b/org/antlr/analysis/LookaheadSet.class deleted file mode 100644 index bde3a88..0000000 Binary files a/org/antlr/analysis/LookaheadSet.class and /dev/null differ diff --git a/org/antlr/analysis/NFA.class b/org/antlr/analysis/NFA.class deleted file mode 100644 index fb0ef20..0000000 Binary files a/org/antlr/analysis/NFA.class and /dev/null differ diff --git a/org/antlr/analysis/NFAConfiguration.class b/org/antlr/analysis/NFAConfiguration.class deleted file mode 100644 index 82646b3..0000000 Binary files a/org/antlr/analysis/NFAConfiguration.class and /dev/null differ diff --git a/org/antlr/analysis/NFAContext.class b/org/antlr/analysis/NFAContext.class deleted file mode 100644 index 52a4575..0000000 Binary files a/org/antlr/analysis/NFAContext.class and /dev/null differ diff --git a/org/antlr/analysis/NFAConversionThread.class b/org/antlr/analysis/NFAConversionThread.class deleted file mode 100644 index 2b4d9d6..0000000 Binary files a/org/antlr/analysis/NFAConversionThread.class and /dev/null differ diff --git a/org/antlr/analysis/NFAState.class b/org/antlr/analysis/NFAState.class deleted file mode 100644 index 2868512..0000000 Binary files a/org/antlr/analysis/NFAState.class and /dev/null differ diff --git a/org/antlr/analysis/NFAToDFAConverter$1.class b/org/antlr/analysis/NFAToDFAConverter$1.class deleted file mode 100644 index 89c7f6a..0000000 Binary files a/org/antlr/analysis/NFAToDFAConverter$1.class and /dev/null differ diff --git a/org/antlr/analysis/NFAToDFAConverter.class b/org/antlr/analysis/NFAToDFAConverter.class deleted file mode 100644 index 9f0d770..0000000 Binary files a/org/antlr/analysis/NFAToDFAConverter.class and /dev/null differ diff --git a/org/antlr/analysis/NonLLStarDecisionException.class b/org/antlr/analysis/NonLLStarDecisionException.class deleted file mode 100644 index 9bd42ec..0000000 Binary files a/org/antlr/analysis/NonLLStarDecisionException.class and /dev/null differ diff --git a/org/antlr/analysis/PredicateLabel.class b/org/antlr/analysis/PredicateLabel.class deleted file mode 100644 index bd14ba9..0000000 Binary files a/org/antlr/analysis/PredicateLabel.class and /dev/null differ diff --git a/org/antlr/analysis/RuleClosureTransition.class b/org/antlr/analysis/RuleClosureTransition.class deleted file mode 100644 index 7a7ef2b..0000000 Binary files a/org/antlr/analysis/RuleClosureTransition.class and /dev/null differ diff --git a/org/antlr/analysis/SemanticContext$AND.class b/org/antlr/analysis/SemanticContext$AND.class deleted file mode 100644 index aefb2db..0000000 Binary files a/org/antlr/analysis/SemanticContext$AND.class and /dev/null differ diff --git a/org/antlr/analysis/SemanticContext$NOT.class b/org/antlr/analysis/SemanticContext$NOT.class deleted file mode 100644 index 721b2a7..0000000 Binary files a/org/antlr/analysis/SemanticContext$NOT.class and /dev/null differ diff --git a/org/antlr/analysis/SemanticContext$OR.class b/org/antlr/analysis/SemanticContext$OR.class deleted file mode 100644 index 738871e..0000000 Binary files a/org/antlr/analysis/SemanticContext$OR.class and /dev/null differ diff --git a/org/antlr/analysis/SemanticContext$Predicate.class b/org/antlr/analysis/SemanticContext$Predicate.class deleted file mode 100644 index 65cdbbe..0000000 Binary files a/org/antlr/analysis/SemanticContext$Predicate.class and /dev/null differ diff --git a/org/antlr/analysis/SemanticContext$TruePredicate.class b/org/antlr/analysis/SemanticContext$TruePredicate.class deleted file mode 100644 index 9e0b20c..0000000 Binary files a/org/antlr/analysis/SemanticContext$TruePredicate.class and /dev/null differ diff --git a/org/antlr/analysis/SemanticContext.class b/org/antlr/analysis/SemanticContext.class deleted file mode 100644 index d37e34e..0000000 Binary files a/org/antlr/analysis/SemanticContext.class and /dev/null differ diff --git a/org/antlr/analysis/State.class b/org/antlr/analysis/State.class deleted file mode 100644 index 36492c2..0000000 Binary files a/org/antlr/analysis/State.class and /dev/null differ diff --git a/org/antlr/analysis/StateCluster.class b/org/antlr/analysis/StateCluster.class deleted file mode 100644 index 8134093..0000000 Binary files a/org/antlr/analysis/StateCluster.class and /dev/null differ diff --git a/org/antlr/analysis/Transition.class b/org/antlr/analysis/Transition.class deleted file mode 100644 index 439f6e3..0000000 Binary files a/org/antlr/analysis/Transition.class and /dev/null differ diff --git a/org/antlr/codegen/ACyclicDFACodeGenerator.class b/org/antlr/codegen/ACyclicDFACodeGenerator.class deleted file mode 100644 index 6de27d0..0000000 Binary files a/org/antlr/codegen/ACyclicDFACodeGenerator.class and /dev/null differ diff --git a/org/antlr/codegen/ActionScriptTarget.class b/org/antlr/codegen/ActionScriptTarget.class deleted file mode 100644 index 2dfd46f..0000000 Binary files a/org/antlr/codegen/ActionScriptTarget.class and /dev/null differ diff --git a/org/antlr/codegen/ActionTranslator$DFA22.class b/org/antlr/codegen/ActionTranslator$DFA22.class deleted file mode 100644 index 3c68364..0000000 Binary files a/org/antlr/codegen/ActionTranslator$DFA22.class and /dev/null differ diff --git a/org/antlr/codegen/ActionTranslator$DFA28.class b/org/antlr/codegen/ActionTranslator$DFA28.class deleted file mode 100644 index faec954..0000000 Binary files a/org/antlr/codegen/ActionTranslator$DFA28.class and /dev/null differ diff --git a/org/antlr/codegen/ActionTranslator.class b/org/antlr/codegen/ActionTranslator.class deleted file mode 100644 index eb82254..0000000 Binary files a/org/antlr/codegen/ActionTranslator.class and /dev/null differ diff --git a/org/antlr/codegen/CPPTarget.class b/org/antlr/codegen/CPPTarget.class deleted file mode 100644 index 51d18e1..0000000 Binary files a/org/antlr/codegen/CPPTarget.class and /dev/null differ diff --git a/org/antlr/codegen/CSharp2Target.class b/org/antlr/codegen/CSharp2Target.class deleted file mode 100644 index ae09de1..0000000 Binary files a/org/antlr/codegen/CSharp2Target.class and /dev/null differ diff --git a/org/antlr/codegen/CSharpTarget.class b/org/antlr/codegen/CSharpTarget.class deleted file mode 100644 index 429f9a7..0000000 Binary files a/org/antlr/codegen/CSharpTarget.class and /dev/null differ diff --git a/org/antlr/codegen/CTarget.class b/org/antlr/codegen/CTarget.class deleted file mode 100644 index 942e2b9..0000000 Binary files a/org/antlr/codegen/CTarget.class and /dev/null differ diff --git a/org/antlr/codegen/CodeGenTreeWalker.class b/org/antlr/codegen/CodeGenTreeWalker.class deleted file mode 100644 index 44c60d9..0000000 Binary files a/org/antlr/codegen/CodeGenTreeWalker.class and /dev/null differ diff --git a/org/antlr/codegen/CodeGenTreeWalkerTokenTypes.class b/org/antlr/codegen/CodeGenTreeWalkerTokenTypes.class deleted file mode 100644 index 1fb25b0..0000000 Binary files a/org/antlr/codegen/CodeGenTreeWalkerTokenTypes.class and /dev/null differ diff --git a/org/antlr/codegen/CodeGenerator.class b/org/antlr/codegen/CodeGenerator.class deleted file mode 100644 index 67531b5..0000000 Binary files a/org/antlr/codegen/CodeGenerator.class and /dev/null differ diff --git a/org/antlr/codegen/JavaScriptTarget.class b/org/antlr/codegen/JavaScriptTarget.class deleted file mode 100644 index f4388fc..0000000 Binary files a/org/antlr/codegen/JavaScriptTarget.class and /dev/null differ diff --git a/org/antlr/codegen/JavaTarget.class b/org/antlr/codegen/JavaTarget.class deleted file mode 100644 index 985f6af..0000000 Binary files a/org/antlr/codegen/JavaTarget.class and /dev/null differ diff --git a/org/antlr/codegen/ObjCTarget.class b/org/antlr/codegen/ObjCTarget.class deleted file mode 100644 index a029cc8..0000000 Binary files a/org/antlr/codegen/ObjCTarget.class and /dev/null differ diff --git a/org/antlr/codegen/Perl5Target.class b/org/antlr/codegen/Perl5Target.class deleted file mode 100644 index c65aec8..0000000 Binary files a/org/antlr/codegen/Perl5Target.class and /dev/null differ diff --git a/org/antlr/codegen/PythonTarget.class b/org/antlr/codegen/PythonTarget.class deleted file mode 100644 index b605e2b..0000000 Binary files a/org/antlr/codegen/PythonTarget.class and /dev/null differ diff --git a/org/antlr/codegen/RubyTarget.class b/org/antlr/codegen/RubyTarget.class deleted file mode 100644 index b30bbe0..0000000 Binary files a/org/antlr/codegen/RubyTarget.class and /dev/null differ diff --git a/org/antlr/codegen/Target.class b/org/antlr/codegen/Target.class deleted file mode 100644 index 6b7c073..0000000 Binary files a/org/antlr/codegen/Target.class and /dev/null differ diff --git a/org/antlr/codegen/templates/ANTLRCore.sti b/org/antlr/codegen/templates/ANTLRCore.sti deleted file mode 100644 index 043d734..0000000 --- a/org/antlr/codegen/templates/ANTLRCore.sti +++ /dev/null @@ -1,375 +0,0 @@ -/* - [The "BSD licence"] - Copyright (c) 2005-2006 Terence Parr - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -interface ANTLRCore; - -/** The overall file structure of a recognizer; stores methods for rules - * and cyclic DFAs plus support code. - */ -outputFile(LEXER,PARSER,TREE_PARSER, actionScope, actions, - docComment, recognizer, - name, tokens, tokenNames, rules, cyclicDFAs, - bitsets, buildTemplate, buildAST, rewriteMode, profile, - backtracking, synpreds, memoize, numRules, - fileName, ANTLRVersion, generatedTimestamp, trace, - scopes, superClass, literals); - -/** The header file; make sure to define headerFileExtension() below */ -optional -headerFile(LEXER,PARSER,TREE_PARSER, actionScope, actions, - docComment, recognizer, - name, tokens, tokenNames, rules, cyclicDFAs, - bitsets, buildTemplate, buildAST, rewriteMode, profile, - backtracking, synpreds, memoize, numRules, - fileName, ANTLRVersion, generatedTimestamp, trace, - scopes, superClass, literals); - -lexer(grammar, name, tokens, scopes, rules, numRules, labelType, - filterMode, superClass); - -parser(grammar, name, scopes, tokens, tokenNames, rules, numRules, - bitsets, ASTLabelType, superClass, - labelType, members); - -/** How to generate a tree parser; same as parser except the input - * stream is a different type. - */ -treeParser(grammar, name, scopes, tokens, tokenNames, globalAction, rules, - numRules, bitsets, labelType, ASTLabelType, - superClass, members); - -/** A simpler version of a rule template that is specific to the imaginary - * rules created for syntactic predicates. As they never have return values - * nor parameters etc..., just give simplest possible method. Don't do - * any of the normal memoization stuff in here either; it's a waste. - * As predicates cannot be inlined into the invoking rule, they need to - * be in a rule by themselves. - */ -synpredRule(ruleName, ruleDescriptor, block, description, nakedBlock); - -/** How to generate code for a rule. This includes any return type - * data aggregates required for multiple return values. - */ -rule(ruleName,ruleDescriptor,block,emptyRule,description,exceptions,finally,memoize); - -/** How to generate a rule in the lexer; naked blocks are used for - * fragment rules. - */ -lexerRule(ruleName,nakedBlock,ruleDescriptor,block,memoize); - -/** How to generate code for the implicitly-defined lexer grammar rule - * that chooses between lexer rules. - */ -tokensRule(ruleName,nakedBlock,args,block,ruleDescriptor); - -filteringNextToken(); - -filteringActionGate(); - -// S U B R U L E S - -/** A (...) subrule with multiple alternatives */ -block(alts,decls,decision,enclosingBlockLevel,blockLevel,decisionNumber,maxK,maxAlt,description); - -/** A rule block with multiple alternatives */ -ruleBlock(alts,decls,decision,enclosingBlockLevel,blockLevel,decisionNumber,maxK,maxAlt,description); - -ruleBlockSingleAlt(alts,decls,decision,enclosingBlockLevel,blockLevel,decisionNumber,description); - -/** A special case of a (...) subrule with a single alternative */ -blockSingleAlt(alts,decls,decision,enclosingBlockLevel,blockLevel,decisionNumber,description); - -/** A (..)+ block with 0 or more alternatives */ -positiveClosureBlock(alts,decls,decision,enclosingBlockLevel,blockLevel,decisionNumber,maxK,maxAlt,description); - -positiveClosureBlockSingleAlt(alts,decls,decision,enclosingBlockLevel,blockLevel,decisionNumber,maxK,maxAlt,description); - -/** A (..)* block with 0 or more alternatives */ -closureBlock(alts,decls,decision,enclosingBlockLevel,blockLevel,decisionNumber,maxK,maxAlt,description); - -closureBlockSingleAlt(alts,decls,decision,enclosingBlockLevel,blockLevel,decisionNumber,maxK,maxAlt,description); - -/** Optional blocks (x)? are translated to (x|) by before code generation - * so we can just use the normal block template - */ -optionalBlock(alts,decls,decision,enclosingBlockLevel,blockLevel,decisionNumber,maxK,maxAlt,description); - -optionalBlockSingleAlt(alts,decls,decision,enclosingBlockLevel,blockLevel,decisionNumber,maxK,maxAlt,description); - -/** An alternative is just a list of elements; at outermost level */ -alt(elements,altNum,description,autoAST,outerAlt,treeLevel,rew); - -// E L E M E N T S - -/** match a token optionally with a label in front */ -tokenRef(token,label,elementIndex,hetero); - -/** ids+=ID */ -tokenRefAndListLabel(token,label,elementIndex,hetero); - -listLabel(label,elem); - -/** match a character */ -charRef(char,label); - -/** match a character range */ -charRangeRef(a,b,label); - -/** For now, sets are interval tests and must be tested inline */ -matchSet(s,label,elementIndex,postmatchCode); - -matchSetAndListLabel(s,label,elementIndex,postmatchCode); - -/** Match a string literal */ -lexerStringRef(string,label); - -wildcard(label,elementIndex); - -wildcardAndListLabel(label,elementIndex); - -/** Match . wildcard in lexer */ -wildcardChar(label, elementIndex); - -wildcardCharListLabel(label, elementIndex); - -/** Match a rule reference by invoking it possibly with arguments - * and a return value or values. - */ -ruleRef(rule,label,elementIndex,args,scope); - -/** ids+=ID */ -ruleRefAndListLabel(rule,label,elementIndex,args,scope); - -/** A lexer rule reference */ -lexerRuleRef(rule,label,args,elementIndex,scope); - -/** i+=INT in lexer */ -lexerRuleRefAndListLabel(rule,label,args,elementIndex,scope); - -/** EOF in the lexer */ -lexerMatchEOF(label,elementIndex); - -/** match ^(root children) in tree parser */ -tree(root, actionsAfterRoot, children, nullableChildList, - enclosingTreeLevel, treeLevel); - -/** Every predicate is used as a validating predicate (even when it is - * also hoisted into a prediction expression). - */ -validateSemanticPredicate(pred,description); - -// F i x e d D F A (if-then-else) - -dfaState(k,edges,eotPredictsAlt,description,stateNumber,semPredState); - -/** Same as a normal DFA state except that we don't examine lookahead - * for the bypass alternative. It delays error detection but this - * is faster, smaller, and more what people expect. For (X)? people - * expect "if ( LA(1)==X ) match(X);" and that's it. - * - * If a semPredState, don't force lookahead lookup; preds might not - * need. - */ -dfaOptionalBlockState(k,edges,eotPredictsAlt,description,stateNumber,semPredState); - -/** A DFA state that is actually the loopback decision of a closure - * loop. If end-of-token (EOT) predicts any of the targets then it - * should act like a default clause (i.e., no error can be generated). - * This is used only in the lexer so that for ('a')* on the end of a - * rule anything other than 'a' predicts exiting. - * - * If a semPredState, don't force lookahead lookup; preds might not - * need. - */ -dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState); - -/** An accept state indicates a unique alternative has been predicted */ -dfaAcceptState(alt); - -/** A simple edge with an expression. If the expression is satisfied, - * enter to the target state. To handle gated productions, we may - * have to evaluate some predicates for this edge. - */ -dfaEdge(labelExpr, targetState, predicates); - -// F i x e d D F A (switch case) - -/** A DFA state where a SWITCH may be generated. The code generator - * decides if this is possible: CodeGenerator.canGenerateSwitch(). - */ -dfaStateSwitch(k,edges,eotPredictsAlt,description,stateNumber,semPredState); - -dfaOptionalBlockStateSwitch(k,edges,eotPredictsAlt,description,stateNumber,semPredState); - -dfaLoopbackStateSwitch(k, edges,eotPredictsAlt,description,stateNumber,semPredState); - -dfaEdgeSwitch(labels, targetState); - -// C y c l i c D F A - -/** The code to initiate execution of a cyclic DFA; this is used - * in the rule to predict an alt just like the fixed DFA case. - * The attribute is inherited via the parser, lexer, ... - */ -dfaDecision(decisionNumber,description); - -/** Generate the tables and support code needed for the DFAState object - * argument. Unless there is a semantic predicate (or syn pred, which - * become sem preds), all states should be encoded in the state tables. - * Consequently, cyclicDFAState/cyclicDFAEdge,eotDFAEdge templates are - * not used except for special DFA states that cannot be encoded as - * a transition table. - */ -cyclicDFA(dfa); - -/** A special state in a cyclic DFA; special means has a semantic predicate - * or it's a huge set of symbols to check. - */ -cyclicDFAState(decisionNumber,stateNumber,edges,needErrorClause,semPredState); - -/** Just like a fixed DFA edge, test the lookahead and indicate what - * state to jump to next if successful. Again, this is for special - * states. - */ -cyclicDFAEdge(labelExpr, targetStateNumber, edgeNumber, predicates); - -/** An edge pointing at end-of-token; essentially matches any char; - * always jump to the target. - */ -eotDFAEdge(targetStateNumber,edgeNumber, predicates); - -// D F A E X P R E S S I O N S - -andPredicates(left,right); - -orPredicates(operands); - -notPredicate(pred); - -evalPredicate(pred,description); - -evalSynPredicate(pred,description); - -lookaheadTest(atom,k,atomAsInt); - -/** Sometimes a lookahead test cannot assume that LA(k) is in a temp variable - * somewhere. Must ask for the lookahead directly. - */ -isolatedLookaheadTest(atom,k,atomAsInt); - -lookaheadRangeTest(lower,upper,k,rangeNumber,lowerAsInt,upperAsInt); - -isolatedLookaheadRangeTest(lower,upper,k,rangeNumber,lowerAsInt,upperAsInt); - -setTest(ranges); - -// A T T R I B U T E S - -parameterAttributeRef(attr); -parameterSetAttributeRef(attr,expr); - -scopeAttributeRef(scope,attr,index,negIndex); -scopeSetAttributeRef(scope,attr,expr,index,negIndex); - -/** $x is either global scope or x is rule with dynamic scope; refers - * to stack itself not top of stack. This is useful for predicates - * like {$function.size()>0 && $function::name.equals("foo")}? - */ -isolatedDynamicScopeRef(scope); - -/** reference an attribute of rule; might only have single return value */ -ruleLabelRef(referencedRule,scope,attr); - -returnAttributeRef(ruleDescriptor,attr); -returnSetAttributeRef(ruleDescriptor,attr,expr); - -/** How to translate $tokenLabel */ -tokenLabelRef(label); - -/** ids+=ID {$ids} or e+=expr {$e} */ -listLabelRef(label); - -// not sure the next are the right approach; and they are evaluated early; -// they cannot see TREE_PARSER or PARSER attributes for example. :( - -tokenLabelPropertyRef_text(scope,attr); -tokenLabelPropertyRef_type(scope,attr); -tokenLabelPropertyRef_line(scope,attr); -tokenLabelPropertyRef_pos(scope,attr); -tokenLabelPropertyRef_channel(scope,attr); -tokenLabelPropertyRef_index(scope,attr); -tokenLabelPropertyRef_tree(scope,attr); - -ruleLabelPropertyRef_start(scope,attr); -ruleLabelPropertyRef_stop(scope,attr); -ruleLabelPropertyRef_tree(scope,attr); -ruleLabelPropertyRef_text(scope,attr); -ruleLabelPropertyRef_st(scope,attr); - -/** Isolated $RULE ref ok in lexer as it's a Token */ -lexerRuleLabel(label); - -lexerRuleLabelPropertyRef_type(scope,attr); -lexerRuleLabelPropertyRef_line(scope,attr); -lexerRuleLabelPropertyRef_pos(scope,attr); -lexerRuleLabelPropertyRef_channel(scope,attr); -lexerRuleLabelPropertyRef_index(scope,attr); -lexerRuleLabelPropertyRef_text(scope,attr); - -// Somebody may ref $template or $tree or $stop within a rule: -rulePropertyRef_start(scope,attr); -rulePropertyRef_stop(scope,attr); -rulePropertyRef_tree(scope,attr); -rulePropertyRef_text(scope,attr); -rulePropertyRef_st(scope,attr); - -lexerRulePropertyRef_text(scope,attr); -lexerRulePropertyRef_type(scope,attr); -lexerRulePropertyRef_line(scope,attr); -lexerRulePropertyRef_pos(scope,attr); -/** Undefined, but present for consistency with Token attributes; set to -1 */ -lexerRulePropertyRef_index(scope,attr); -lexerRulePropertyRef_channel(scope,attr); -lexerRulePropertyRef_start(scope,attr); -lexerRulePropertyRef_stop(scope,attr); - -ruleSetPropertyRef_tree(scope,attr,expr); -ruleSetPropertyRef_st(scope,attr,expr); - -/** How to execute an action */ -execAction(action); - -// M I S C (properties, etc...) - -codeFileExtension(); - -/** Your language needs a header file; e.g., ".h" */ -optional headerFileExtension(); - -true(); -false(); diff --git a/org/antlr/codegen/templates/ActionScript/AST.stg b/org/antlr/codegen/templates/ActionScript/AST.stg deleted file mode 100644 index f0d2a68..0000000 --- a/org/antlr/codegen/templates/ActionScript/AST.stg +++ /dev/null @@ -1,391 +0,0 @@ -/* - [The "BSD licence"] - Copyright (c) 2005-2006 Terence Parr - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -group AST; - -@outputFile.imports() ::= << -<@super.imports()> - -import org.antlr.runtime.tree.*;<\n> - ->> - -@genericParser.members() ::= << -<@super.members()> - ->> - -/** Add an adaptor property that knows how to build trees */ -parserMembers() ::= << -protected var adaptor:TreeAdaptor = new CommonTreeAdaptor();<\n> -public function set treeAdaptor(adaptor:TreeAdaptor):void { - this.adaptor = adaptor; -} -public function get treeAdaptor():TreeAdaptor { - return adaptor; -} ->> - -@returnScope.ruleReturnMembers() ::= << - tree; -public function get tree():Object { return tree; } ->> - -/** Add a variable to track rule's return AST */ -ruleDeclarations() ::= << - -var root_0: = null;<\n> ->> - -ruleLabelDefs() ::= << - -_tree:=null;}; separator="\n"> -_tree:=null;}; separator="\n"> -:RewriteRuleStream=new RewriteRuleStream(adaptor,"token ");}; separator="\n"> -:RewriteRuleSubtreeStream=new RewriteRuleSubtreeStream(adaptor,"rule ");}; separator="\n"> ->> - -/** When doing auto AST construction, we must define some variables; - * These should be turned off if doing rewrites. This must be a "mode" - * as a rule could have both rewrite and AST within the same alternative - * block. - */ -@alt.declarations() ::= << - - - -root_0 = (adaptor.nil());<\n> - - - ->> - -// T r a c k i n g R u l e E l e m e n t s - -/** ID and track it for use in a rewrite rule */ -tokenRefTrack(token,label,elementIndex,hetero) ::= << - -if ( state.backtracking==0 ) stream_.add(