├── .github
└── workflows
│ └── main.yml
├── .gitignore
├── BUILD.bazel
├── BUILD.txt
├── README.txt
├── WORKSPACE.bazel
├── antlr-ant
└── main
│ └── antlr3-task
│ ├── Readme.txt
│ ├── antlr3-src
│ └── org
│ │ └── apache
│ │ └── tools
│ │ └── ant
│ │ └── antlr
│ │ ├── ANTLR3.java
│ │ └── antlib.xml
│ ├── antlr3-task.doc
│ ├── antlr3-task.htm
│ ├── antlr3.jar
│ ├── composite-java_build.zip
│ ├── composite-netbeans.zip
│ ├── d2u.zip
│ ├── polydiff-netbeans.zip
│ ├── polydiff_build.zip
│ └── simplecTreeParser.zip
├── antlr-complete
├── antlr.config
└── pom.xml
├── antlr.config
├── antlr3-maven-archetype
├── antlr.config
├── pom.xml
└── src
│ └── main
│ └── resources
│ ├── META-INF
│ └── maven
│ │ ├── archetype-metadata.xml
│ │ └── archetype.xml
│ └── archetype-resources
│ ├── pom.xml
│ └── src
│ └── main
│ ├── antlr3
│ ├── TLexer.g
│ ├── TParser.g
│ ├── TTree.g
│ └── imports
│ │ └── Ruleb.g
│ └── java
│ ├── AbstractTLexer.java
│ ├── AbstractTParser.java
│ └── Main.java
├── antlr3-maven-plugin
├── antlr.config
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── antlr
│ │ └── mojo
│ │ └── antlr3
│ │ ├── Antlr3ErrorLog.java
│ │ └── Antlr3Mojo.java
│ └── site
│ ├── apt
│ ├── examples
│ │ ├── import.apt
│ │ ├── libraries.apt
│ │ └── simple.apt
│ ├── faq.apt.vm
│ ├── index.apt
│ └── usage.apt.vm
│ └── site.xml
├── contributors.txt
├── gunit-maven-plugin
├── antlr.config
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── antlr
│ └── mojo
│ └── antlr3
│ └── GUnitExecuteMojo.java
├── gunit
├── CHANGES.txt
├── LICENSE.txt
├── README.txt
├── antlr.config
├── pom.xml
└── src
│ ├── main
│ ├── antlr3
│ │ └── org
│ │ │ └── antlr
│ │ │ └── gunit
│ │ │ ├── gUnit.g
│ │ │ └── swingui
│ │ │ └── parsers
│ │ │ ├── ANTLRv3.g
│ │ │ └── StGUnit.g
│ ├── java
│ │ └── org
│ │ │ └── antlr
│ │ │ └── gunit
│ │ │ ├── AbstractTest.java
│ │ │ ├── BooleanTest.java
│ │ │ ├── GrammarInfo.java
│ │ │ ├── ITestCase.java
│ │ │ ├── ITestSuite.java
│ │ │ ├── Interp.java
│ │ │ ├── InvalidInputException.java
│ │ │ ├── JUnitCodeGen.java
│ │ │ ├── OutputTest.java
│ │ │ ├── ReturnTest.java
│ │ │ ├── gUnitBaseTest.java
│ │ │ ├── gUnitExecutor.java
│ │ │ ├── gUnitTestInput.java
│ │ │ ├── gUnitTestResult.java
│ │ │ ├── gUnitTestSuite.java
│ │ │ └── swingui
│ │ │ ├── AbstractInputEditor.java
│ │ │ ├── IController.java
│ │ │ ├── ImageFactory.java
│ │ │ ├── RuleListController.java
│ │ │ ├── RunnerController.java
│ │ │ ├── StatusBarController.java
│ │ │ ├── TestCaseEditController.java
│ │ │ ├── Tool.java
│ │ │ ├── WorkSpaceController.java
│ │ │ ├── WorkSpaceView.java
│ │ │ ├── model
│ │ │ ├── ITestCaseInput.java
│ │ │ ├── ITestCaseOutput.java
│ │ │ ├── Rule.java
│ │ │ ├── TestCase.java
│ │ │ ├── TestCaseInputFile.java
│ │ │ ├── TestCaseInputMultiString.java
│ │ │ ├── TestCaseInputString.java
│ │ │ ├── TestCaseOutputAST.java
│ │ │ ├── TestCaseOutputResult.java
│ │ │ ├── TestCaseOutputReturn.java
│ │ │ ├── TestCaseOutputStdOut.java
│ │ │ ├── TestSuite.java
│ │ │ └── TestSuiteFactory.java
│ │ │ └── runner
│ │ │ ├── NotifiedTestExecuter.java
│ │ │ ├── ParserLoader.java
│ │ │ ├── TestSuiteAdapter.java
│ │ │ └── gUnitAdapter.java
│ └── resources
│ │ └── org
│ │ └── antlr
│ │ └── gunit
│ │ ├── gUnitTestResult.stg
│ │ ├── junit.stg
│ │ └── swingui
│ │ ├── gunit.stg
│ │ └── images
│ │ ├── accept.png
│ │ ├── add.png
│ │ ├── addfile24.png
│ │ ├── delete24.png
│ │ ├── edit16.png
│ │ ├── favb16.png
│ │ ├── favb24.png
│ │ ├── file16.png
│ │ ├── filesearch24.png
│ │ ├── floppy24.png
│ │ ├── folder24.png
│ │ ├── help24.png
│ │ ├── next24.png
│ │ ├── redo24.png
│ │ ├── refresh24.png
│ │ ├── runfail.png
│ │ ├── runpass.png
│ │ ├── saveas24.png
│ │ ├── testgroup.png
│ │ ├── testgroupx.png
│ │ ├── testsuite.png
│ │ ├── textfile16.png
│ │ ├── textfile24.png
│ │ ├── undo24.png
│ │ └── windowb16.png
│ └── test
│ └── java
│ └── org
│ └── antlr
│ └── gunit
│ └── GunitTest.java
├── pom.xml
├── runtime
├── ActionScript
│ ├── AUTHORS
│ ├── LICENSE
│ ├── README
│ ├── lib
│ │ └── antlr3.swc
│ └── project
│ │ ├── .actionScriptProperties
│ │ ├── .flexLibProperties
│ │ ├── .project
│ │ ├── .settings
│ │ └── org.eclipse.core.resources.prefs
│ │ ├── README.txt
│ │ ├── build.xml
│ │ ├── lib
│ │ ├── FlexAntTasks.jar
│ │ ├── FlexUnitOptional.swc
│ │ └── flexunit.swc
│ │ ├── src
│ │ └── org
│ │ │ └── antlr
│ │ │ └── runtime
│ │ │ ├── ANTLRFileStream.as
│ │ │ ├── ANTLRStringStream.as
│ │ │ ├── BaseRecognizer.as
│ │ │ ├── BitSet.as
│ │ │ ├── CharStream.as
│ │ │ ├── CharStreamConstants.as
│ │ │ ├── CharStreamState.as
│ │ │ ├── CommonToken.as
│ │ │ ├── CommonTokenStream.as
│ │ │ ├── DFA.as
│ │ │ ├── EarlyExitException.as
│ │ │ ├── FailedPredicateException.as
│ │ │ ├── IntStream.as
│ │ │ ├── Lexer.as
│ │ │ ├── MismatchedNotSetException.as
│ │ │ ├── MismatchedRangeException.as
│ │ │ ├── MismatchedSetException.as
│ │ │ ├── MismatchedTokenException.as
│ │ │ ├── MismatchedTreeNodeException.as
│ │ │ ├── MissingTokenException.as
│ │ │ ├── NoViableAltException.as
│ │ │ ├── Parser.as
│ │ │ ├── ParserRuleReturnScope.as
│ │ │ ├── RecognitionException.as
│ │ │ ├── RecognizerSharedState.as
│ │ │ ├── RuleReturnScope.as
│ │ │ ├── Token.as
│ │ │ ├── TokenConstants.as
│ │ │ ├── TokenRewriteStream.as
│ │ │ ├── TokenSource.as
│ │ │ ├── TokenStream.as
│ │ │ ├── UnwantedTokenException.as
│ │ │ ├── tree
│ │ │ ├── BaseTree.as
│ │ │ ├── BaseTreeAdaptor.as
│ │ │ ├── CommonErrorNode.as
│ │ │ ├── CommonTree.as
│ │ │ ├── CommonTreeAdaptor.as
│ │ │ ├── CommonTreeNodeStream.as
│ │ │ ├── RewriteCardinalityException.as
│ │ │ ├── RewriteEarlyExitException.as
│ │ │ ├── RewriteEmptyStreamException.as
│ │ │ ├── RewriteRuleElementStream.as
│ │ │ ├── RewriteRuleNodeStream.as
│ │ │ ├── RewriteRuleSubtreeStream.as
│ │ │ ├── RewriteRuleTokenStream.as
│ │ │ ├── Tree.as
│ │ │ ├── TreeAdaptor.as
│ │ │ ├── TreeConstants.as
│ │ │ ├── TreeNodeStream.as
│ │ │ ├── TreeParser.as
│ │ │ └── TreeRuleReturnScope.as
│ │ │ └── version.as
│ │ └── test
│ │ ├── Antlr3Test.mxml
│ │ └── org
│ │ └── antlr
│ │ └── runtime
│ │ └── test
│ │ ├── AllTests.as
│ │ ├── TestANTLRStringStream.as
│ │ ├── TestBitSet.as
│ │ └── TestDFA.as
├── C
│ ├── AUTHORS
│ ├── C.sln
│ ├── C.vcproj
│ ├── C.vcproj.vspscc
│ ├── C.vssscc
│ ├── COPYING
│ ├── ChangeLog
│ ├── Cvs2005.sln
│ ├── Cvs2005.vcproj
│ ├── INSTALL
│ ├── Makefile.am
│ ├── NEWS
│ ├── README
│ ├── configure.ac
│ ├── dist
│ │ ├── libantlr3c-3.1.4-SNAPSHOT.tar.gz
│ │ ├── libantlr3c-3.3.1-SNAPSHOT.tar.gz
│ │ └── libantlr3c-3.4-beta3.tar.gz
│ ├── doxyfile
│ ├── doxygen
│ │ ├── atsections.dox
│ │ ├── build.dox
│ │ ├── buildrec.dox
│ │ ├── changes31.dox
│ │ ├── doxygengroups.dox
│ │ ├── generate.dox
│ │ ├── interop.dox
│ │ ├── knownissues.dox
│ │ ├── mainpage.dox
│ │ ├── runtime.dox
│ │ └── using.dox
│ ├── include
│ │ ├── antlr3.h
│ │ ├── antlr3baserecognizer.h
│ │ ├── antlr3basetree.h
│ │ ├── antlr3basetreeadaptor.h
│ │ ├── antlr3bitset.h
│ │ ├── antlr3collections.h
│ │ ├── antlr3commontoken.h
│ │ ├── antlr3commontree.h
│ │ ├── antlr3commontreeadaptor.h
│ │ ├── antlr3commontreenodestream.h
│ │ ├── antlr3convertutf.h
│ │ ├── antlr3cyclicdfa.h
│ │ ├── antlr3debugeventlistener.h
│ │ ├── antlr3defs.h
│ │ ├── antlr3encodings.h
│ │ ├── antlr3errors.h
│ │ ├── antlr3exception.h
│ │ ├── antlr3filestream.h
│ │ ├── antlr3input.h
│ │ ├── antlr3interfaces.h
│ │ ├── antlr3intstream.h
│ │ ├── antlr3lexer.h
│ │ ├── antlr3memory.h
│ │ ├── antlr3parser.h
│ │ ├── antlr3parsetree.h
│ │ ├── antlr3recognizersharedstate.h
│ │ ├── antlr3rewritestreams.h
│ │ ├── antlr3string.h
│ │ ├── antlr3tokenstream.h
│ │ └── antlr3treeparser.h
│ ├── m4
│ │ └── dummy
│ ├── src
│ │ ├── antlr3baserecognizer.c
│ │ ├── antlr3basetree.c
│ │ ├── antlr3basetreeadaptor.c
│ │ ├── antlr3bitset.c
│ │ ├── antlr3collections.c
│ │ ├── antlr3commontoken.c
│ │ ├── antlr3commontree.c
│ │ ├── antlr3commontreeadaptor.c
│ │ ├── antlr3commontreenodestream.c
│ │ ├── antlr3convertutf.c
│ │ ├── antlr3cyclicdfa.c
│ │ ├── antlr3debughandlers.c
│ │ ├── antlr3encodings.c
│ │ ├── antlr3exception.c
│ │ ├── antlr3filestream.c
│ │ ├── antlr3inputstream.c
│ │ ├── antlr3intstream.c
│ │ ├── antlr3lexer.c
│ │ ├── antlr3parser.c
│ │ ├── antlr3rewritestreams.c
│ │ ├── antlr3string.c
│ │ ├── antlr3tokenstream.c
│ │ └── antlr3treeparser.c
│ └── vsrulefiles
│ │ ├── antlr3lexer.rules
│ │ ├── antlr3lexerandparser.rules
│ │ ├── antlr3parser.rules
│ │ └── antlr3treeparser.rules
├── CSharp2
│ ├── API CHANGES.TXT
│ ├── Cutting a new release.txt
│ ├── LICENSE.TXT
│ ├── Libraries
│ │ ├── MbUnit
│ │ │ ├── MbUnit.Framework.dll
│ │ │ ├── MbUnit.MSBuild.Tasks.dll
│ │ │ ├── MbUnit.Tasks.dll
│ │ │ ├── QuickGraph.Algorithms.dll
│ │ │ └── QuickGraph.dll
│ │ └── StringTemplate.NET
│ │ │ └── net-2.0
│ │ │ ├── StringTemplate.dll
│ │ │ └── antlr.runtime.dll
│ ├── NOTICE.TXT
│ ├── README.TXT
│ ├── Sources
│ │ ├── Antlr3.Runtime (VS2005).sln
│ │ ├── Antlr3.Runtime (VS2008).sln
│ │ ├── Antlr3.Runtime.Tests
│ │ │ ├── ANTLRxxxxStreamFixture.cs
│ │ │ ├── Antlr3.Runtime.Tests (VS2005).csproj
│ │ │ ├── Antlr3.Runtime.Tests (VS2008).csproj
│ │ │ ├── ITreeFixture.cs
│ │ │ ├── ITreeNodeStreamFixture.cs
│ │ │ ├── Properties
│ │ │ │ └── AssemblyInfo.cs
│ │ │ ├── RewriteRuleXxxxStreamFixture.cs
│ │ │ ├── TestDriver.cs
│ │ │ └── TestFixtureBase.cs
│ │ ├── Antlr3.Runtime
│ │ │ ├── Antlr.Runtime.Collections
│ │ │ │ ├── HashList.cs
│ │ │ │ └── StackList.cs
│ │ │ ├── Antlr.Runtime.Debug
│ │ │ │ ├── BlankDebugEventListener.cs
│ │ │ │ ├── DebugEventHub.cs
│ │ │ │ ├── DebugEventListenerConstants.cs
│ │ │ │ ├── DebugEventRepeater.cs
│ │ │ │ ├── DebugEventSocketProxy.cs
│ │ │ │ ├── DebugParser.cs
│ │ │ │ ├── DebugTokenStream.cs
│ │ │ │ ├── DebugTreeAdaptor.cs
│ │ │ │ ├── DebugTreeNodeStream.cs
│ │ │ │ ├── DebugTreeParser.cs
│ │ │ │ ├── IDebugEventListener.cs
│ │ │ │ ├── ParseTreeBuilder.cs
│ │ │ │ ├── Profiler.cs
│ │ │ │ ├── RemoteDebugEventSocketListener.cs
│ │ │ │ ├── TraceDebugEventListener.cs
│ │ │ │ └── Tracer.cs
│ │ │ ├── Antlr.Runtime.JavaExtensions
│ │ │ │ ├── Check.cs
│ │ │ │ ├── DictionaryExtensions.cs
│ │ │ │ ├── EnumerableExtensions.cs
│ │ │ │ ├── ExceptionExtensions.cs
│ │ │ │ ├── IOExtensions.cs
│ │ │ │ ├── JSystem.cs
│ │ │ │ ├── LexerExtensions.cs
│ │ │ │ ├── StringExtensions.cs
│ │ │ │ └── StringTokenizer.cs
│ │ │ ├── Antlr.Runtime.Misc
│ │ │ │ ├── DoubleKeyMap.cs
│ │ │ │ ├── ErrorManager.cs
│ │ │ │ ├── FastQueue.cs
│ │ │ │ ├── LookaheadStream.cs
│ │ │ │ └── Stats.cs
│ │ │ ├── Antlr.Runtime.Tree
│ │ │ │ ├── BaseTree.cs
│ │ │ │ ├── BaseTreeAdaptor.cs
│ │ │ │ ├── BufferedTreeNodeStream.cs
│ │ │ │ ├── CommonErrorNode.cs
│ │ │ │ ├── CommonTree.cs
│ │ │ │ ├── CommonTreeAdaptor.cs
│ │ │ │ ├── CommonTreeNodeStream.cs
│ │ │ │ ├── DotTreeGenerator.cs
│ │ │ │ ├── ITree.cs
│ │ │ │ ├── ITreeAdaptor.cs
│ │ │ │ ├── ITreeNodeStream.cs
│ │ │ │ ├── ITreeVisitorAction.cs
│ │ │ │ ├── ParseTree.cs
│ │ │ │ ├── RewriteCardinalityException.cs
│ │ │ │ ├── RewriteEarlyExitException.cs
│ │ │ │ ├── RewriteEmptyStreamException.cs
│ │ │ │ ├── RewriteRuleElementStream.cs
│ │ │ │ ├── RewriteRuleNodeStream.cs
│ │ │ │ ├── RewriteRuleSubtreeStream.cs
│ │ │ │ ├── RewriteRuleTokenStream.cs
│ │ │ │ ├── TreeConstants.cs
│ │ │ │ ├── TreeFilter.cs
│ │ │ │ ├── TreeIterator.cs
│ │ │ │ ├── TreeParser.cs
│ │ │ │ ├── TreePatternLexer.cs
│ │ │ │ ├── TreePatternParser.cs
│ │ │ │ ├── TreeRewriter.cs
│ │ │ │ ├── TreeRuleReturnScope.cs
│ │ │ │ ├── TreeVisitor.cs
│ │ │ │ └── TreeWizard.cs
│ │ │ ├── Antlr.Runtime
│ │ │ │ ├── ANTLRFileStream.cs
│ │ │ │ ├── ANTLRInputStream.cs
│ │ │ │ ├── ANTLRReaderStream.cs
│ │ │ │ ├── ANTLRStringStream.cs
│ │ │ │ ├── BaseRecognizer.cs
│ │ │ │ ├── BitSet.cs
│ │ │ │ ├── BufferedTokenStream.cs
│ │ │ │ ├── CharStreamConstants.cs
│ │ │ │ ├── CharStreamState.cs
│ │ │ │ ├── ClassicToken.cs
│ │ │ │ ├── CommonToken.cs
│ │ │ │ ├── CommonTokenStream.cs
│ │ │ │ ├── Constants.cs
│ │ │ │ ├── DFA.cs
│ │ │ │ ├── EarlyExitException.cs
│ │ │ │ ├── FailedPredicateException.cs
│ │ │ │ ├── GrammarRuleAttribute.cs
│ │ │ │ ├── ICharStream.cs
│ │ │ │ ├── IIntStream.cs
│ │ │ │ ├── IToken.cs
│ │ │ │ ├── ITokenSource.cs
│ │ │ │ ├── ITokenStream.cs
│ │ │ │ ├── ITokenStreamInformation.cs
│ │ │ │ ├── LegacyCommonTokenStream.cs
│ │ │ │ ├── Lexer.cs
│ │ │ │ ├── MismatchedNotSetException.cs
│ │ │ │ ├── MismatchedRangeException.cs
│ │ │ │ ├── MismatchedSetException.cs
│ │ │ │ ├── MismatchedTokenException.cs
│ │ │ │ ├── MismatchedTreeNodeException.cs
│ │ │ │ ├── MissingTokenException.cs
│ │ │ │ ├── NoViableAltException.cs
│ │ │ │ ├── Parser.cs
│ │ │ │ ├── ParserRuleReturnScope.cs
│ │ │ │ ├── RecognitionException.cs
│ │ │ │ ├── RecognizerSharedState.cs
│ │ │ │ ├── RuleReturnScope.cs
│ │ │ │ ├── TokenConstants.cs
│ │ │ │ ├── TokenRewriteStream.cs
│ │ │ │ ├── UnbufferedTokenStream.cs
│ │ │ │ └── UnwantedTokenException.cs
│ │ │ ├── Antlr3.Runtime (VS2005).csproj
│ │ │ ├── Antlr3.Runtime (VS2008).csproj
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Messages.Designer.cs
│ │ │ ├── Messages.resx
│ │ │ └── default.build
│ │ ├── Antlr3.Utility
│ │ │ ├── Antlr.Utility.Tree
│ │ │ │ └── DOTTreeGenerator.cs
│ │ │ ├── Antlr3.Utility (VS2005).csproj
│ │ │ ├── Antlr3.Utility (VS2008).csproj
│ │ │ ├── AssemblyInfo.cs
│ │ │ └── default.build
│ │ ├── Antlr3_KeyPair.snk
│ │ └── Antlr3_PublicKey.snk
│ ├── all.antlr3.runtime.net.build
│ ├── antlr3.runtime.net.common.inc
│ ├── dist
│ │ └── DOT-NET-runtime-3.1.3.zip
│ └── doxyfile
├── Cpp
│ ├── include
│ │ ├── antlr3.hpp
│ │ ├── antlr3.inl
│ │ ├── antlr3baserecognizer.hpp
│ │ ├── antlr3baserecognizer.inl
│ │ ├── antlr3bitset.hpp
│ │ ├── antlr3bitset.inl
│ │ ├── antlr3collections.hpp
│ │ ├── antlr3collections.inl
│ │ ├── antlr3commontoken.hpp
│ │ ├── antlr3commontoken.inl
│ │ ├── antlr3commontree.hpp
│ │ ├── antlr3commontree.inl
│ │ ├── antlr3commontreeadaptor.hpp
│ │ ├── antlr3commontreeadaptor.inl
│ │ ├── antlr3commontreenodestream.hpp
│ │ ├── antlr3commontreenodestream.inl
│ │ ├── antlr3convertutf.hpp
│ │ ├── antlr3cyclicdfa.hpp
│ │ ├── antlr3cyclicdfa.inl
│ │ ├── antlr3debugeventlistener.hpp
│ │ ├── antlr3defs.hpp
│ │ ├── antlr3errors.hpp
│ │ ├── antlr3exception.hpp
│ │ ├── antlr3exception.inl
│ │ ├── antlr3filestream.hpp
│ │ ├── antlr3filestream.inl
│ │ ├── antlr3input.hpp
│ │ ├── antlr3input.inl
│ │ ├── antlr3interfaces.hpp
│ │ ├── antlr3intstream.hpp
│ │ ├── antlr3intstream.inl
│ │ ├── antlr3lexer.hpp
│ │ ├── antlr3lexer.inl
│ │ ├── antlr3memory.hpp
│ │ ├── antlr3parser.hpp
│ │ ├── antlr3parser.inl
│ │ ├── antlr3recognizersharedstate.hpp
│ │ ├── antlr3recognizersharedstate.inl
│ │ ├── antlr3rewritestreams.hpp
│ │ ├── antlr3rewritestreams.inl
│ │ ├── antlr3tokenstream.hpp
│ │ ├── antlr3tokenstream.inl
│ │ ├── antlr3traits.hpp
│ │ ├── antlr3treeparser.hpp
│ │ └── antlr3treeparser.inl
│ └── tests
│ │ ├── .gitignore
│ │ ├── Makefile
│ │ ├── UserTestTraits.hpp
│ │ ├── t001.cpp
│ │ ├── t001lexer.g
│ │ ├── t002.cpp
│ │ ├── t002lexer.g
│ │ ├── t003.cpp
│ │ ├── t003lexer.g
│ │ ├── t004.cpp
│ │ ├── t004lexer.g
│ │ ├── t005.cpp
│ │ ├── t005lexer.g
│ │ ├── t006.cpp
│ │ ├── t006lexer.g
│ │ ├── t007.cpp
│ │ ├── t007lexer.g
│ │ ├── t008.cpp
│ │ ├── t008lexer.g
│ │ ├── t009.cpp
│ │ ├── t009lexer.g
│ │ ├── t010.cpp
│ │ ├── t010lexer.g
│ │ ├── t011.cpp
│ │ ├── t011lexer.g
│ │ ├── t012.cpp
│ │ ├── t012lexerXML.input
│ │ ├── t012lexerXML.output
│ │ ├── t012lexerXMLLexer.g
│ │ ├── t013parser.g
│ │ ├── t014parser.g
│ │ ├── t015calc.g
│ │ ├── t016actions.g
│ │ ├── t017parser.g
│ │ ├── t018llstar.g
│ │ ├── t019lexer.g
│ │ ├── t020fuzzyLexer.g
│ │ ├── t021hoist.g
│ │ ├── t022scopes.g
│ │ ├── t023scopes.g
│ │ ├── t024finally.g
│ │ ├── t025lexerRulePropertyRef.g
│ │ ├── t026actions.g
│ │ ├── t027eof.g
│ │ ├── t029synpredgate.g
│ │ ├── t030specialStates.g
│ │ ├── t031emptyAlt.g
│ │ ├── t032subrulePredict.g
│ │ ├── t033backtracking.g
│ │ ├── t034tokenLabelPropertyRef.g
│ │ ├── t035ruleLabelPropertyRef.g
│ │ ├── t036multipleReturnValues.g
│ │ ├── t037rulePropertyRef.g
│ │ ├── t038lexerRuleLabel.g
│ │ ├── t039.cpp
│ │ ├── t039labels.g
│ │ ├── t040bug80.g
│ │ ├── t041parameters.g
│ │ ├── t042ast.g
│ │ ├── t043synpred.g
│ │ ├── t044trace.g
│ │ ├── t045dfabug.g
│ │ ├── t046rewrite.g
│ │ ├── t047treeparser.g
│ │ ├── t047treeparserWalker.g
│ │ ├── t048rewrite.g
│ │ ├── t048rewrite2.g
│ │ ├── t050decorate.g
│ │ ├── t051.cpp
│ │ ├── t051.input
│ │ └── t051lexer.g
├── Delphi
│ ├── LICENSE.TXT
│ ├── NOTICE.TXT
│ ├── README.TXT
│ └── Sources
│ │ ├── Antlr3.Runtime.Tests
│ │ ├── Antlr.Runtime.Collections.Tests.pas
│ │ ├── Antlr.Runtime.Tests.pas
│ │ ├── Antlr.Runtime.Tools.Tests.pas
│ │ ├── Antlr.Runtime.Tree.Tests.pas
│ │ ├── TestDriver.dpr
│ │ ├── TestDriver.dproj
│ │ └── TestDriver.res
│ │ └── Antlr3.Runtime
│ │ ├── Antlr.Runtime.Collections.pas
│ │ ├── Antlr.Runtime.Tools.pas
│ │ ├── Antlr.Runtime.Tree.pas
│ │ └── Antlr.Runtime.pas
├── Java
│ ├── antlr.config
│ ├── doxyfile
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── org
│ │ │ └── antlr
│ │ │ └── runtime
│ │ │ ├── ANTLRFileStream.java
│ │ │ ├── ANTLRInputStream.java
│ │ │ ├── ANTLRReaderStream.java
│ │ │ ├── ANTLRStringStream.java
│ │ │ ├── BaseRecognizer.java
│ │ │ ├── BitSet.java
│ │ │ ├── BufferedTokenStream.java
│ │ │ ├── CharStream.java
│ │ │ ├── CharStreamState.java
│ │ │ ├── ClassicToken.java
│ │ │ ├── CommonToken.java
│ │ │ ├── CommonTokenStream.java
│ │ │ ├── DFA.java
│ │ │ ├── EarlyExitException.java
│ │ │ ├── FailedPredicateException.java
│ │ │ ├── IntStream.java
│ │ │ ├── LegacyCommonTokenStream.java
│ │ │ ├── Lexer.java
│ │ │ ├── MismatchedNotSetException.java
│ │ │ ├── MismatchedRangeException.java
│ │ │ ├── MismatchedSetException.java
│ │ │ ├── MismatchedTokenException.java
│ │ │ ├── MismatchedTreeNodeException.java
│ │ │ ├── MissingTokenException.java
│ │ │ ├── NoViableAltException.java
│ │ │ ├── Parser.java
│ │ │ ├── ParserRuleReturnScope.java
│ │ │ ├── RecognitionException.java
│ │ │ ├── RecognizerSharedState.java
│ │ │ ├── RuleReturnScope.java
│ │ │ ├── SerializedGrammar.java
│ │ │ ├── Token.java
│ │ │ ├── TokenRewriteStream.java
│ │ │ ├── TokenSource.java
│ │ │ ├── TokenStream.java
│ │ │ ├── UnbufferedTokenStream.java
│ │ │ ├── UnwantedTokenException.java
│ │ │ ├── debug
│ │ │ ├── BlankDebugEventListener.java
│ │ │ ├── DebugEventHub.java
│ │ │ ├── DebugEventListener.java
│ │ │ ├── DebugEventRepeater.java
│ │ │ ├── DebugEventSocketProxy.java
│ │ │ ├── DebugParser.java
│ │ │ ├── DebugTokenStream.java
│ │ │ ├── DebugTreeAdaptor.java
│ │ │ ├── DebugTreeNodeStream.java
│ │ │ ├── DebugTreeParser.java
│ │ │ ├── ParseTreeBuilder.java
│ │ │ ├── Profiler.java
│ │ │ ├── RemoteDebugEventSocketListener.java
│ │ │ ├── TraceDebugEventListener.java
│ │ │ └── Tracer.java
│ │ │ ├── misc
│ │ │ ├── DoubleKeyMap.java
│ │ │ ├── FastQueue.java
│ │ │ ├── IntArray.java
│ │ │ ├── LookaheadStream.java
│ │ │ └── Stats.java
│ │ │ └── tree
│ │ │ ├── BaseTree.java
│ │ │ ├── BaseTreeAdaptor.java
│ │ │ ├── BufferedTreeNodeStream.java
│ │ │ ├── CommonErrorNode.java
│ │ │ ├── CommonTree.java
│ │ │ ├── CommonTreeAdaptor.java
│ │ │ ├── CommonTreeNodeStream.java
│ │ │ ├── DOTTreeGenerator.java
│ │ │ ├── ParseTree.java
│ │ │ ├── PositionTrackingStream.java
│ │ │ ├── RewriteCardinalityException.java
│ │ │ ├── RewriteEarlyExitException.java
│ │ │ ├── RewriteEmptyStreamException.java
│ │ │ ├── RewriteRuleElementStream.java
│ │ │ ├── RewriteRuleNodeStream.java
│ │ │ ├── RewriteRuleSubtreeStream.java
│ │ │ ├── RewriteRuleTokenStream.java
│ │ │ ├── Tree.java
│ │ │ ├── TreeAdaptor.java
│ │ │ ├── TreeFilter.java
│ │ │ ├── TreeIterator.java
│ │ │ ├── TreeNodeStream.java
│ │ │ ├── TreeParser.java
│ │ │ ├── TreePatternLexer.java
│ │ │ ├── TreePatternParser.java
│ │ │ ├── TreeRewriter.java
│ │ │ ├── TreeRuleReturnScope.java
│ │ │ ├── TreeVisitor.java
│ │ │ ├── TreeVisitorAction.java
│ │ │ └── TreeWizard.java
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── antlr
│ │ └── runtime
│ │ └── TestLookaheadStream.java
├── JavaScript
│ ├── AUTHORS
│ ├── ChangeLog
│ ├── build
│ │ ├── README
│ │ ├── antlr3.properties
│ │ ├── build.xml
│ │ └── license.txt
│ ├── src
│ │ └── org
│ │ │ ├── antlr.js
│ │ │ └── antlr
│ │ │ └── runtime
│ │ │ ├── ANTLRFileStream.js
│ │ │ ├── ANTLRStringStream.js
│ │ │ ├── BaseRecognizer.js
│ │ │ ├── BitSet.js
│ │ │ ├── CharStream.js
│ │ │ ├── CommonToken.js
│ │ │ ├── CommonTokenStream.js
│ │ │ ├── DFA.js
│ │ │ ├── EarlyExitException.js
│ │ │ ├── FailedPredicateException.js
│ │ │ ├── IndexOutOfBoundsExceptions.js
│ │ │ ├── Lexer.js
│ │ │ ├── MismatchedNotSetException.js
│ │ │ ├── MismatchedRangeExceptions.js
│ │ │ ├── MismatchedSetException.js
│ │ │ ├── MismatchedTokenException.js
│ │ │ ├── MismatchedTreeNodeException.js
│ │ │ ├── MissingTokenException.js
│ │ │ ├── NoViableAltException.js
│ │ │ ├── Parser.js
│ │ │ ├── ParserRuleReturnScope.js
│ │ │ ├── RecognitionException.js
│ │ │ ├── RecognizerSharedState.js
│ │ │ ├── Token.js
│ │ │ ├── TokenRewriteStream.js
│ │ │ ├── UnwantedTokenException.js
│ │ │ └── tree
│ │ │ ├── BaseTree.js
│ │ │ ├── BaseTreeAdaptor.js
│ │ │ ├── CommonErrorNode.js
│ │ │ ├── CommonTree.js
│ │ │ ├── CommonTreeAdaptor.js
│ │ │ ├── CommonTreeNodeStream.js
│ │ │ ├── RewriteCardinalityException.js
│ │ │ ├── RewriteEarlyExitException.js
│ │ │ ├── RewriteEmptyStreamException.js
│ │ │ ├── RewriteRuleElementStream.js
│ │ │ ├── RewriteRuleNodeStream.js
│ │ │ ├── RewriteRuleSubtreeStream.js
│ │ │ ├── RewriteRuleTokenStream.js
│ │ │ ├── Tree.js
│ │ │ ├── TreeNodeStream.js
│ │ │ ├── TreeParser.js
│ │ │ └── TreeRuleReturnScope.js
│ ├── tests
│ │ └── functional
│ │ │ ├── Python.g
│ │ │ ├── all.html
│ │ │ ├── rhino-python.extensions
│ │ │ ├── rhino-python.input
│ │ │ ├── rhino-python.output
│ │ │ ├── rhino-python.prog
│ │ │ ├── t001lexer.g
│ │ │ ├── t001lexer.html
│ │ │ ├── t002lexer.g
│ │ │ ├── t002lexer.html
│ │ │ ├── t003lexer.g
│ │ │ ├── t003lexer.html
│ │ │ ├── t004lexer.g
│ │ │ ├── t004lexer.html
│ │ │ ├── t005lexer.g
│ │ │ ├── t005lexer.html
│ │ │ ├── t006lexer.g
│ │ │ ├── t006lexer.html
│ │ │ ├── t007lexer.g
│ │ │ ├── t007lexer.html
│ │ │ ├── t008lexer.g
│ │ │ ├── t008lexer.html
│ │ │ ├── t009lexer.g
│ │ │ ├── t009lexer.html
│ │ │ ├── t010lexer.g
│ │ │ ├── t010lexer.html
│ │ │ ├── t011lexer.g
│ │ │ ├── t011lexer.html
│ │ │ ├── t012lexerXML.g
│ │ │ ├── t012lexerXML.html
│ │ │ ├── t013parser.g
│ │ │ ├── t013parser.html
│ │ │ ├── t014parser.g
│ │ │ ├── t014parser.html
│ │ │ ├── t015calc.g
│ │ │ ├── t015calc.html
│ │ │ ├── t016actions.g
│ │ │ ├── t016actions.html
│ │ │ ├── t017parser.g
│ │ │ ├── t017parser.html
│ │ │ ├── t018llstar.g
│ │ │ ├── t018llstar.html
│ │ │ ├── t019lexer.g
│ │ │ ├── t019lexer.html
│ │ │ ├── t020fuzzy.g
│ │ │ ├── t020fuzzy.html
│ │ │ ├── t021hoist.g
│ │ │ ├── t021hoist.html
│ │ │ ├── t022scopes.g
│ │ │ ├── t022scopes.html
│ │ │ ├── t023scopes.g
│ │ │ ├── t023scopes.html
│ │ │ ├── t024finally.g
│ │ │ ├── t024finally.html
│ │ │ ├── t025lexerRulePropertyRef.g
│ │ │ ├── t025lexerRulePropertyRef.html
│ │ │ ├── t026actions.g
│ │ │ ├── t026actions.html
│ │ │ ├── t027eof.g
│ │ │ ├── t027eof.html
│ │ │ ├── t029synpredgate.g
│ │ │ ├── t029synpredgate.html
│ │ │ ├── t030specialStates.g
│ │ │ ├── t030specialStates.html
│ │ │ ├── t031emptyAlt.g
│ │ │ ├── t031emptyAlt.html
│ │ │ ├── t032subrulePredict.g
│ │ │ ├── t032subrulePredict.html
│ │ │ ├── t033backtracking.g
│ │ │ ├── t033backtracking.html
│ │ │ ├── t034tokenLabelPropertyRef.g
│ │ │ ├── t034tokenLabelPropertyRef.html
│ │ │ ├── t035ruleLabelPropertyRef.g
│ │ │ ├── t035ruleLabelPropertyRef.html
│ │ │ ├── t036multipleReturnValues.g
│ │ │ ├── t036multipleReturnValues.html
│ │ │ ├── t037rulePropertyRef.g
│ │ │ ├── t037rulePropertyRef.html
│ │ │ ├── t038lexerRuleLabel.g
│ │ │ ├── t038lexerRuleLabel.html
│ │ │ ├── t039labels.g
│ │ │ ├── t039labels.html
│ │ │ ├── t040bug80.g
│ │ │ ├── t040bug80.html
│ │ │ ├── t041parameters.g
│ │ │ ├── t041parameters.html
│ │ │ ├── t042ast.g
│ │ │ ├── t042ast.html
│ │ │ ├── t043synpred.g
│ │ │ ├── t043synpred.html
│ │ │ ├── t044trace.g
│ │ │ ├── t044trace.html
│ │ │ ├── t045dfabug.g
│ │ │ ├── t045dfabug.html
│ │ │ ├── t046rewrite.g
│ │ │ ├── t046rewrite.html
│ │ │ ├── t047treeparser.g
│ │ │ ├── t047treeparser.html
│ │ │ ├── t047treeparserWalker.g
│ │ │ ├── t048rewrite.g
│ │ │ ├── t048rewrite.html
│ │ │ ├── t049treeparser.html
│ │ │ ├── t049treeparsera.g
│ │ │ ├── t049treeparseraWalker.g
│ │ │ ├── t049treeparserb.g
│ │ │ ├── t049treeparserbWalker.g
│ │ │ ├── t049treeparserc.g
│ │ │ ├── t049treeparsercWalker.g
│ │ │ ├── t049treeparserd.g
│ │ │ ├── t049treeparserdWalker.g
│ │ │ ├── t049treeparsere.g
│ │ │ ├── t049treeparsereWalker.g
│ │ │ ├── t049treeparserf.g
│ │ │ ├── t049treeparserfWalker.g
│ │ │ ├── t049treeparserg.g
│ │ │ ├── t049treeparsergWalker.g
│ │ │ ├── t049treeparserh.g
│ │ │ ├── t049treeparserhWalker.g
│ │ │ ├── t049treeparseri.g
│ │ │ ├── t049treeparseriWalker.g
│ │ │ ├── t051treeRewriteAST.html
│ │ │ ├── t051treeRewriteASTa.g
│ │ │ ├── t051treeRewriteASTaWalker.g
│ │ │ ├── t051treeRewriteASTaa.g
│ │ │ ├── t051treeRewriteASTaaWalker.g
│ │ │ ├── t051treeRewriteASTab.g
│ │ │ ├── t051treeRewriteASTabWalker.g
│ │ │ ├── t051treeRewriteASTac.g
│ │ │ ├── t051treeRewriteASTacWalker.g
│ │ │ ├── t051treeRewriteASTb.g
│ │ │ ├── t051treeRewriteASTbWalker.g
│ │ │ ├── t051treeRewriteASTc.g
│ │ │ ├── t051treeRewriteASTcWalker.g
│ │ │ ├── t051treeRewriteASTd.g
│ │ │ ├── t051treeRewriteASTdWalker.g
│ │ │ ├── t051treeRewriteASTe.g
│ │ │ ├── t051treeRewriteASTeWalker.g
│ │ │ ├── t051treeRewriteASTf.g
│ │ │ ├── t051treeRewriteASTfWalker.g
│ │ │ ├── t051treeRewriteASTg.g
│ │ │ ├── t051treeRewriteASTgWalker.g
│ │ │ ├── t051treeRewriteASTh.g
│ │ │ ├── t051treeRewriteASThWalker.g
│ │ │ ├── t051treeRewriteASTi.g
│ │ │ ├── t051treeRewriteASTiWalker.g
│ │ │ ├── t051treeRewriteASTj.g
│ │ │ ├── t051treeRewriteASTjWalker.g
│ │ │ ├── t051treeRewriteASTk.g
│ │ │ ├── t051treeRewriteASTkWalker.g
│ │ │ ├── t051treeRewriteASTl.g
│ │ │ ├── t051treeRewriteASTlWalker.g
│ │ │ ├── t051treeRewriteASTm.g
│ │ │ ├── t051treeRewriteASTmWalker.g
│ │ │ ├── t051treeRewriteASTn.g
│ │ │ ├── t051treeRewriteASTnWalker.g
│ │ │ ├── t051treeRewriteASTo.g
│ │ │ ├── t051treeRewriteASToWalker.g
│ │ │ ├── t051treeRewriteASTp.g
│ │ │ ├── t051treeRewriteASTpWalker.g
│ │ │ ├── t051treeRewriteASTq.g
│ │ │ ├── t051treeRewriteASTqWalker.g
│ │ │ ├── t051treeRewriteASTr.g
│ │ │ ├── t051treeRewriteASTrWalker.g
│ │ │ ├── t051treeRewriteASTs.g
│ │ │ ├── t051treeRewriteASTsWalker.g
│ │ │ ├── t051treeRewriteASTt.g
│ │ │ ├── t051treeRewriteASTtWalker.g
│ │ │ ├── t051treeRewriteASTu.g
│ │ │ ├── t051treeRewriteASTuWalker.g
│ │ │ ├── t051treeRewriteASTv.g
│ │ │ ├── t051treeRewriteASTvWalker.g
│ │ │ ├── t051treeRewriteASTw.g
│ │ │ ├── t051treeRewriteASTwWalker.g
│ │ │ ├── t051treeRewriteASTx.g
│ │ │ ├── t051treeRewriteASTxWalker.g
│ │ │ ├── t051treeRewriteASTy.g
│ │ │ ├── t051treeRewriteASTyWalker.g
│ │ │ ├── t051treeRewriteASTz.g
│ │ │ ├── t051treeRewriteASTzWalker.g
│ │ │ ├── t052import.html
│ │ │ ├── t052importM1.g
│ │ │ ├── t052importM2.g
│ │ │ ├── t052importM3.g
│ │ │ ├── t052importM4.g
│ │ │ ├── t052importM5.g
│ │ │ ├── t052importM6.g
│ │ │ ├── t052importM7.g
│ │ │ ├── t052importM8.g
│ │ │ ├── t052importS1.g
│ │ │ ├── t052importS2.g
│ │ │ ├── t052importS3.g
│ │ │ ├── t052importS4.g
│ │ │ ├── t052importS5.g
│ │ │ ├── t052importS6.g
│ │ │ ├── t052importS7.g
│ │ │ ├── t052importS8.g
│ │ │ ├── t052importT4.g
│ │ │ ├── t052importT5.g
│ │ │ ├── t053hetero.html
│ │ │ ├── t053heteroT.g
│ │ │ ├── t053heteroT1.g
│ │ │ ├── t053heteroT10.g
│ │ │ ├── t053heteroT11.g
│ │ │ ├── t053heteroT12.g
│ │ │ ├── t053heteroT13.g
│ │ │ ├── t053heteroT14.g
│ │ │ ├── t053heteroT15.g
│ │ │ ├── t053heteroT16.g
│ │ │ ├── t053heteroT17.g
│ │ │ ├── t053heteroT18.g
│ │ │ ├── t053heteroT2.g
│ │ │ ├── t053heteroT3.g
│ │ │ ├── t053heteroT4.g
│ │ │ ├── t053heteroT5.g
│ │ │ ├── t053heteroT6.g
│ │ │ ├── t053heteroT7.g
│ │ │ ├── t053heteroT8.g
│ │ │ ├── t053heteroT9.g
│ │ │ ├── t053heteroTP.g
│ │ │ ├── t053heteroTP13.g
│ │ │ ├── t053heteroTP14.g
│ │ │ ├── t053heteroTP15.g
│ │ │ ├── t053heteroTP16.g
│ │ │ ├── t053heteroTP17.g
│ │ │ ├── t053heteroTP18.g
│ │ │ ├── t056lexer.html
│ │ │ ├── t056lexer1.g
│ │ │ ├── t056lexer10.g
│ │ │ ├── t056lexer11.g
│ │ │ ├── t056lexer12.g
│ │ │ ├── t056lexer13.g
│ │ │ ├── t056lexer14.g
│ │ │ ├── t056lexer15.g
│ │ │ ├── t056lexer2.g
│ │ │ ├── t056lexer3.g
│ │ │ ├── t056lexer4.g
│ │ │ ├── t056lexer5.g
│ │ │ ├── t056lexer6.g
│ │ │ ├── t056lexer7.g
│ │ │ ├── t056lexer8.g
│ │ │ ├── t056lexer9.g
│ │ │ ├── t057autoAST.html
│ │ │ ├── t057autoAST1.g
│ │ │ ├── t057autoAST10.g
│ │ │ ├── t057autoAST11.g
│ │ │ ├── t057autoAST12.g
│ │ │ ├── t057autoAST13.g
│ │ │ ├── t057autoAST14.g
│ │ │ ├── t057autoAST15.g
│ │ │ ├── t057autoAST16.g
│ │ │ ├── t057autoAST17.g
│ │ │ ├── t057autoAST18.g
│ │ │ ├── t057autoAST19.g
│ │ │ ├── t057autoAST2.g
│ │ │ ├── t057autoAST20.g
│ │ │ ├── t057autoAST21.g
│ │ │ ├── t057autoAST22.g
│ │ │ ├── t057autoAST23.g
│ │ │ ├── t057autoAST24.g
│ │ │ ├── t057autoAST25.g
│ │ │ ├── t057autoAST26.g
│ │ │ ├── t057autoAST27.g
│ │ │ ├── t057autoAST28.g
│ │ │ ├── t057autoAST29.g
│ │ │ ├── t057autoAST3.g
│ │ │ ├── t057autoAST30.g
│ │ │ ├── t057autoAST31.g
│ │ │ ├── t057autoAST32.g
│ │ │ ├── t057autoAST33.g
│ │ │ ├── t057autoAST34.g
│ │ │ ├── t057autoAST35.g
│ │ │ ├── t057autoAST36.g
│ │ │ ├── t057autoAST37.g
│ │ │ ├── t057autoAST38.g
│ │ │ ├── t057autoAST39.g
│ │ │ ├── t057autoAST4.g
│ │ │ ├── t057autoAST40.g
│ │ │ ├── t057autoAST41.g
│ │ │ ├── t057autoAST42.g
│ │ │ ├── t057autoAST43.g
│ │ │ ├── t057autoAST44.g
│ │ │ ├── t057autoAST45.g
│ │ │ ├── t057autoAST46.g
│ │ │ ├── t057autoAST47.g
│ │ │ ├── t057autoAST48.g
│ │ │ ├── t057autoAST49.g
│ │ │ ├── t057autoAST5.g
│ │ │ ├── t057autoAST50.g
│ │ │ ├── t057autoAST51.g
│ │ │ ├── t057autoAST52.g
│ │ │ ├── t057autoAST53.g
│ │ │ ├── t057autoAST54.g
│ │ │ ├── t057autoAST6.g
│ │ │ ├── t057autoAST7.g
│ │ │ ├── t057autoAST8.g
│ │ │ ├── t057autoAST9.g
│ │ │ ├── t058rewriteAST.html
│ │ │ ├── t058rewriteAST1.g
│ │ │ ├── t058rewriteAST10.g
│ │ │ ├── t058rewriteAST11.g
│ │ │ ├── t058rewriteAST12.g
│ │ │ ├── t058rewriteAST13.g
│ │ │ ├── t058rewriteAST14.g
│ │ │ ├── t058rewriteAST15.g
│ │ │ ├── t058rewriteAST16.g
│ │ │ ├── t058rewriteAST17.g
│ │ │ ├── t058rewriteAST18.g
│ │ │ ├── t058rewriteAST19.g
│ │ │ ├── t058rewriteAST2.g
│ │ │ ├── t058rewriteAST20.g
│ │ │ ├── t058rewriteAST21.g
│ │ │ ├── t058rewriteAST22.g
│ │ │ ├── t058rewriteAST23.g
│ │ │ ├── t058rewriteAST24.g
│ │ │ ├── t058rewriteAST25.g
│ │ │ ├── t058rewriteAST26.g
│ │ │ ├── t058rewriteAST27.g
│ │ │ ├── t058rewriteAST28.g
│ │ │ ├── t058rewriteAST29.g
│ │ │ ├── t058rewriteAST3.g
│ │ │ ├── t058rewriteAST30.g
│ │ │ ├── t058rewriteAST31.g
│ │ │ ├── t058rewriteAST32.g
│ │ │ ├── t058rewriteAST33.g
│ │ │ ├── t058rewriteAST34.g
│ │ │ ├── t058rewriteAST35.g
│ │ │ ├── t058rewriteAST36.g
│ │ │ ├── t058rewriteAST37.g
│ │ │ ├── t058rewriteAST38.g
│ │ │ ├── t058rewriteAST39.g
│ │ │ ├── t058rewriteAST4.g
│ │ │ ├── t058rewriteAST40.g
│ │ │ ├── t058rewriteAST41.g
│ │ │ ├── t058rewriteAST42.g
│ │ │ ├── t058rewriteAST43.g
│ │ │ ├── t058rewriteAST44.g
│ │ │ ├── t058rewriteAST45.g
│ │ │ ├── t058rewriteAST46.g
│ │ │ ├── t058rewriteAST47.g
│ │ │ ├── t058rewriteAST48.g
│ │ │ ├── t058rewriteAST49.g
│ │ │ ├── t058rewriteAST5.g
│ │ │ ├── t058rewriteAST50.g
│ │ │ ├── t058rewriteAST51.g
│ │ │ ├── t058rewriteAST52.g
│ │ │ ├── t058rewriteAST53.g
│ │ │ ├── t058rewriteAST54.g
│ │ │ ├── t058rewriteAST55.g
│ │ │ ├── t058rewriteAST56.g
│ │ │ ├── t058rewriteAST57.g
│ │ │ ├── t058rewriteAST58.g
│ │ │ ├── t058rewriteAST59.g
│ │ │ ├── t058rewriteAST6.g
│ │ │ ├── t058rewriteAST60.g
│ │ │ ├── t058rewriteAST61.g
│ │ │ ├── t058rewriteAST62.g
│ │ │ ├── t058rewriteAST63.g
│ │ │ ├── t058rewriteAST64.g
│ │ │ ├── t058rewriteAST65.g
│ │ │ ├── t058rewriteAST66.g
│ │ │ ├── t058rewriteAST67.g
│ │ │ ├── t058rewriteAST68.g
│ │ │ ├── t058rewriteAST69.g
│ │ │ ├── t058rewriteAST7.g
│ │ │ ├── t058rewriteAST70.g
│ │ │ ├── t058rewriteAST71.g
│ │ │ ├── t058rewriteAST72.g
│ │ │ ├── t058rewriteAST73.g
│ │ │ ├── t058rewriteAST74.g
│ │ │ ├── t058rewriteAST75.g
│ │ │ ├── t058rewriteAST76.g
│ │ │ ├── t058rewriteAST77.g
│ │ │ ├── t058rewriteAST78.g
│ │ │ ├── t058rewriteAST79.g
│ │ │ ├── t058rewriteAST8.g
│ │ │ ├── t058rewriteAST80.g
│ │ │ ├── t058rewriteAST81.g
│ │ │ ├── t058rewriteAST82.g
│ │ │ ├── t058rewriteAST83.g
│ │ │ └── t058rewriteAST9.g
│ └── third
│ │ └── antcontrib.properties
├── ObjC
│ ├── ANTLR.framework.zip
│ ├── ANTLR.framework
│ │ ├── ANTLR
│ │ ├── Headers
│ │ ├── Resources
│ │ └── Versions
│ │ │ └── Current
│ ├── Framework
│ │ ├── ACBTree.h
│ │ ├── ACBTree.m
│ │ ├── ACNumber.h
│ │ ├── ACNumber.m
│ │ ├── AMutableArray.h
│ │ ├── AMutableArray.m
│ │ ├── AMutableDictionary.h
│ │ ├── AMutableDictionary.m
│ │ ├── ANTLR.h
│ │ ├── ANTLR.xcodeproj
│ │ │ ├── acondit.mode1v3
│ │ │ ├── acondit.pbxuser
│ │ │ └── project.pbxproj
│ │ ├── ANTLR
│ │ │ ├── .DS_Store
│ │ │ ├── ANTLR.xcodeproj
│ │ │ │ ├── project.xcworkspace
│ │ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ │ └── xcuserdata
│ │ │ │ │ │ └── acondit.xcuserdatad
│ │ │ │ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ │ │ │ └── xcdebugger
│ │ │ │ │ │ └── Expressions.xcexplist
│ │ │ │ └── xcuserdata
│ │ │ │ │ └── acondit.xcuserdatad
│ │ │ │ │ └── xcschemes
│ │ │ │ │ ├── ANTLRTests.xcscheme
│ │ │ │ │ ├── combined.xcscheme
│ │ │ │ │ ├── hoistedPredicates.xcscheme
│ │ │ │ │ ├── lexertest-simple.xcscheme
│ │ │ │ │ ├── polydiff.xcscheme
│ │ │ │ │ ├── scopes.xcscheme
│ │ │ │ │ ├── simplecTreeParser.xcscheme
│ │ │ │ │ ├── treeparser.xcscheme
│ │ │ │ │ └── treerewrite.xcscheme
│ │ │ ├── ANTLR
│ │ │ │ ├── ANTLR-Info.plist
│ │ │ │ ├── ANTLR-Prefix.pch
│ │ │ │ └── en.lproj
│ │ │ │ │ └── InfoPlist.strings
│ │ │ └── ANTLRTests
│ │ │ │ └── en.lproj
│ │ │ │ └── InfoPlist.strings
│ │ ├── ANTLRBitSet.h
│ │ ├── ANTLRBitSet.m
│ │ ├── ANTLRBitsetTest-Info.plist
│ │ ├── ANTLRCommonTokenTest-Info.plist
│ │ ├── ANTLRCommonTreeTest-Info.plist
│ │ ├── ANTLRError.h
│ │ ├── ANTLRFastQueueTest-Info.plist
│ │ ├── ANTLRFileStream.h
│ │ ├── ANTLRFileStream.m
│ │ ├── ANTLRInputStream.h
│ │ ├── ANTLRInputStream.m
│ │ ├── ANTLRIntArrayTest-Info.plist
│ │ ├── ANTLRReaderStream.h
│ │ ├── ANTLRReaderStream.m
│ │ ├── ANTLRStringStream.h
│ │ ├── ANTLRStringStream.m
│ │ ├── ANTLRStringStreamTest-Info.plist
│ │ ├── ANTLR_Prefix.pch
│ │ ├── ArrayIterator.h
│ │ ├── ArrayIterator.m
│ │ ├── BaseMapElement.h
│ │ ├── BaseMapElement.m
│ │ ├── BaseRecognizer.h
│ │ ├── BaseRecognizer.m
│ │ ├── BaseStack.h
│ │ ├── BaseStack.m
│ │ ├── BaseTree.h
│ │ ├── BaseTree.m
│ │ ├── BaseTreeAdaptor.h
│ │ ├── BaseTreeAdaptor.m
│ │ ├── BufferedTokenStream.h
│ │ ├── BufferedTokenStream.m
│ │ ├── BufferedTreeNodeStream.h
│ │ ├── BufferedTreeNodeStream.m
│ │ ├── CHANGES.txt
│ │ ├── CharStream.h
│ │ ├── CharStreamState.h
│ │ ├── CharStreamState.m
│ │ ├── CommonErrorNode.h
│ │ ├── CommonErrorNode.m
│ │ ├── CommonToken.h
│ │ ├── CommonToken.m
│ │ ├── CommonTokenStream.h
│ │ ├── CommonTokenStream.m
│ │ ├── CommonTree.h
│ │ ├── CommonTree.m
│ │ ├── CommonTreeAdaptor.h
│ │ ├── CommonTreeAdaptor.m
│ │ ├── CommonTreeNodeStream.h
│ │ ├── CommonTreeNodeStream.m
│ │ ├── DFA.h
│ │ ├── DFA.m
│ │ ├── Debug.h
│ │ ├── DebugEventListener.h
│ │ ├── DebugEventSocketProxy.h
│ │ ├── DebugEventSocketProxy.m
│ │ ├── DebugParser.h
│ │ ├── DebugParser.m
│ │ ├── DebugTokenStream.h
│ │ ├── DebugTokenStream.m
│ │ ├── DebugTreeAdaptor.h
│ │ ├── DebugTreeAdaptor.m
│ │ ├── DebugTreeNodeStream.h
│ │ ├── DebugTreeNodeStream.m
│ │ ├── DebugTreeParser.h
│ │ ├── DebugTreeParser.m
│ │ ├── DoubleKeyMap.h
│ │ ├── DoubleKeyMap.m
│ │ ├── EarlyExitException.h
│ │ ├── EarlyExitException.m
│ │ ├── English.lproj
│ │ │ └── InfoPlist.strings
│ │ ├── Entry.h
│ │ ├── Entry.m
│ │ ├── FailedPredicateException.h
│ │ ├── FailedPredicateException.m
│ │ ├── FastQueue.h
│ │ ├── FastQueue.m
│ │ ├── HashMap.h
│ │ ├── HashMap.m
│ │ ├── HashRule.h
│ │ ├── HashRule.m
│ │ ├── Info.plist
│ │ ├── IntArray.h
│ │ ├── IntArray.m
│ │ ├── IntStream.h
│ │ ├── Lexer.h
│ │ ├── Lexer.m
│ │ ├── LexerRuleReturnScope.h
│ │ ├── LexerRuleReturnScope.m
│ │ ├── LexerState.h
│ │ ├── LexerState.m
│ │ ├── LinkBase.h
│ │ ├── LinkBase.m
│ │ ├── LinkedHashMap.h
│ │ ├── LinkedHashMap.m
│ │ ├── LinkedList.h
│ │ ├── LinkedList.m
│ │ ├── LookaheadStream.h
│ │ ├── LookaheadStream.m
│ │ ├── Map.h
│ │ ├── Map.m
│ │ ├── MapElement.h
│ │ ├── MapElement.m
│ │ ├── MismatchedNotSetException.h
│ │ ├── MismatchedNotSetException.m
│ │ ├── MismatchedRangeException.h
│ │ ├── MismatchedRangeException.m
│ │ ├── MismatchedSetException.h
│ │ ├── MismatchedSetException.m
│ │ ├── MismatchedTokenException.h
│ │ ├── MismatchedTokenException.m
│ │ ├── MismatchedTreeNodeException.h
│ │ ├── MismatchedTreeNodeException.m
│ │ ├── MissingTokenException.h
│ │ ├── MissingTokenException.m
│ │ ├── NoViableAltException.h
│ │ ├── NoViableAltException.m
│ │ ├── NodeMapElement.h
│ │ ├── NodeMapElement.m
│ │ ├── ParseTree.h
│ │ ├── ParseTree.m
│ │ ├── Parser.h
│ │ ├── Parser.m
│ │ ├── ParserRuleReturnScope.h
│ │ ├── ParserRuleReturnScope.m
│ │ ├── PtrBuffer.h
│ │ ├── PtrBuffer.m
│ │ ├── PtrStack.h
│ │ ├── PtrStack.m
│ │ ├── README.rtf
│ │ ├── RecognitionException.h
│ │ ├── RecognitionException.m
│ │ ├── RecognizerSharedState.h
│ │ ├── RecognizerSharedState.m
│ │ ├── RewriteRuleElementStream.h
│ │ ├── RewriteRuleElementStream.m
│ │ ├── RewriteRuleNodeStream.h
│ │ ├── RewriteRuleNodeStream.m
│ │ ├── RewriteRuleSubtreeStream.h
│ │ ├── RewriteRuleSubtreeStream.m
│ │ ├── RewriteRuleTokenStream.h
│ │ ├── RewriteRuleTokenStream.m
│ │ ├── RuleMapElement.h
│ │ ├── RuleMapElement.m
│ │ ├── RuleMemo.h
│ │ ├── RuleMemo.m
│ │ ├── RuleReturnScope.h
│ │ ├── RuleReturnScope.m
│ │ ├── RuleStack.h
│ │ ├── RuleStack.m
│ │ ├── RuntimeException.h
│ │ ├── RuntimeException.m
│ │ ├── StreamEnumerator.h
│ │ ├── StreamEnumerator.m
│ │ ├── StringStreamState.h
│ │ ├── SymbolStack.h
│ │ ├── SymbolStack.m
│ │ ├── Test-Info.plist
│ │ ├── Tests-Info.plist
│ │ ├── Token+DebuggerSupport.h
│ │ ├── Token+DebuggerSupport.m
│ │ ├── Token.h
│ │ ├── TokenRewriteStream.h
│ │ ├── TokenRewriteStream.m
│ │ ├── TokenSource.h
│ │ ├── TokenStream.h
│ │ ├── Tree.h
│ │ ├── Tree.m
│ │ ├── TreeAdaptor.h
│ │ ├── TreeAdaptor.m
│ │ ├── TreeException.h
│ │ ├── TreeException.m
│ │ ├── TreeFilter.h
│ │ ├── TreeFilter.m
│ │ ├── TreeIterator.h
│ │ ├── TreeIterator.m
│ │ ├── TreeNodeStream.h
│ │ ├── TreeParser.h
│ │ ├── TreeParser.m
│ │ ├── TreePatternLexer.h
│ │ ├── TreePatternLexer.m
│ │ ├── TreePatternParser.h
│ │ ├── TreePatternParser.m
│ │ ├── TreeRewriter.h
│ │ ├── TreeRewriter.m
│ │ ├── TreeRuleReturnScope.h
│ │ ├── TreeRuleReturnScope.m
│ │ ├── TreeVisitor.h
│ │ ├── TreeVisitor.m
│ │ ├── TreeVisitorAction.h
│ │ ├── TreeVisitorAction.m
│ │ ├── TreeWizard.h
│ │ ├── TreeWizard.m
│ │ ├── UnbufferedCommonTreeNodeStream.h
│ │ ├── UnbufferedCommonTreeNodeStream.m
│ │ ├── UnbufferedCommonTreeNodeStreamState.h
│ │ ├── UnbufferedCommonTreeNodeStreamState.m
│ │ ├── UnbufferedTokenStream.h
│ │ ├── UnbufferedTokenStream.m
│ │ ├── UniqueIDMap.h
│ │ ├── UniqueIDMap.m
│ │ ├── UnwantedTokenException.h
│ │ ├── UnwantedTokenException.m
│ │ ├── antlr3.h
│ │ ├── examples
│ │ │ ├── LL-star
│ │ │ │ ├── SimpleC.tokens
│ │ │ │ ├── SimpleCLexer.h
│ │ │ │ ├── SimpleCLexer.m
│ │ │ │ ├── SimpleCParser.h
│ │ │ │ ├── SimpleCParser.m
│ │ │ │ ├── SimpleC__.gl
│ │ │ │ ├── input
│ │ │ │ ├── main.m
│ │ │ │ ├── output
│ │ │ │ └── simplec.g
│ │ │ ├── combined
│ │ │ │ ├── Combined.g
│ │ │ │ ├── Combined.tokens
│ │ │ │ ├── CombinedLexer.h
│ │ │ │ ├── CombinedLexer.m
│ │ │ │ ├── CombinedParser.h
│ │ │ │ ├── CombinedParser.m
│ │ │ │ ├── Combined__.gl
│ │ │ │ └── main.m
│ │ │ ├── fuzzy
│ │ │ │ ├── Fuzzy.g
│ │ │ │ ├── Fuzzy.h
│ │ │ │ ├── Fuzzy.m
│ │ │ │ ├── Fuzzy.tokens
│ │ │ │ ├── FuzzyLexer.h
│ │ │ │ ├── input
│ │ │ │ └── main.m
│ │ │ ├── hoistedPredicates
│ │ │ │ ├── T.g
│ │ │ │ ├── T.tokens
│ │ │ │ ├── TLexer.h
│ │ │ │ ├── TLexer.m
│ │ │ │ ├── TParser.h
│ │ │ │ ├── TParser.m
│ │ │ │ ├── input
│ │ │ │ ├── main.m
│ │ │ │ └── output
│ │ │ ├── lexertest-simple
│ │ │ │ ├── Test.tokens
│ │ │ │ ├── TestLexer.g
│ │ │ │ ├── TestLexer.h
│ │ │ │ ├── TestLexer.m
│ │ │ │ ├── TestLexer.tokens
│ │ │ │ └── main.m
│ │ │ ├── polydiff
│ │ │ │ ├── Poly.g
│ │ │ │ ├── Poly.tokens
│ │ │ │ ├── PolyDifferentiator.g
│ │ │ │ ├── PolyDifferentiator.h
│ │ │ │ ├── PolyDifferentiator.m
│ │ │ │ ├── PolyDifferentiator.tokens
│ │ │ │ ├── PolyLexer.h
│ │ │ │ ├── PolyLexer.m
│ │ │ │ ├── PolyParser.h
│ │ │ │ ├── PolyParser.m
│ │ │ │ ├── PolyPrinter.g
│ │ │ │ ├── PolyPrinter.h
│ │ │ │ ├── PolyPrinter.m
│ │ │ │ ├── PolyPrinter.tokens
│ │ │ │ ├── Simplifier.g
│ │ │ │ ├── Simplifier.h
│ │ │ │ ├── Simplifier.m
│ │ │ │ ├── Simplifier.tokens
│ │ │ │ ├── files
│ │ │ │ ├── input
│ │ │ │ ├── main.m
│ │ │ │ └── output
│ │ │ ├── scopes
│ │ │ │ ├── SymbolTable.g
│ │ │ │ ├── SymbolTable.tokens
│ │ │ │ ├── SymbolTableLexer.h
│ │ │ │ ├── SymbolTableLexer.m
│ │ │ │ ├── SymbolTableParser.h
│ │ │ │ ├── SymbolTableParser.m
│ │ │ │ ├── SymbolTable__.gl
│ │ │ │ ├── input
│ │ │ │ ├── main.m
│ │ │ │ └── output
│ │ │ ├── simplecTreeParser
│ │ │ │ ├── SimpleC.g
│ │ │ │ ├── SimpleC.tokens
│ │ │ │ ├── SimpleCLexer.h
│ │ │ │ ├── SimpleCLexer.java
│ │ │ │ ├── SimpleCLexer.m
│ │ │ │ ├── SimpleCParser.h
│ │ │ │ ├── SimpleCParser.java
│ │ │ │ ├── SimpleCParser.m
│ │ │ │ ├── SimpleCTP.g
│ │ │ │ ├── SimpleCTP.h
│ │ │ │ ├── SimpleCTP.java
│ │ │ │ ├── SimpleCTP.m
│ │ │ │ ├── SimpleCTP.tokens
│ │ │ │ ├── SimpleCWalker.g
│ │ │ │ ├── SimpleCWalker.h
│ │ │ │ ├── SimpleCWalker.m
│ │ │ │ ├── SimpleCWalker.tokens
│ │ │ │ ├── SimpleC__.gl
│ │ │ │ ├── input
│ │ │ │ ├── main.m
│ │ │ │ └── output
│ │ │ ├── treeparser
│ │ │ │ ├── Lang.g
│ │ │ │ ├── Lang.tokens
│ │ │ │ ├── LangDumpDecl.g
│ │ │ │ ├── LangDumpDecl.h
│ │ │ │ ├── LangDumpDecl.m
│ │ │ │ ├── LangDumpDecl.tokens
│ │ │ │ ├── LangLexer.h
│ │ │ │ ├── LangLexer.m
│ │ │ │ ├── LangParser.h
│ │ │ │ ├── LangParser.m
│ │ │ │ ├── Main.java
│ │ │ │ ├── README.txt
│ │ │ │ ├── files
│ │ │ │ ├── input
│ │ │ │ ├── main.m
│ │ │ │ └── output
│ │ │ └── treerewrite
│ │ │ │ ├── TreeRewrite.g
│ │ │ │ ├── TreeRewrite.tokens
│ │ │ │ ├── TreeRewriteLexer.h
│ │ │ │ ├── TreeRewriteLexer.m
│ │ │ │ ├── TreeRewriteParser.h
│ │ │ │ ├── TreeRewriteParser.m
│ │ │ │ └── main.m
│ │ ├── filelist.java
│ │ ├── filelist.objc
│ │ └── test
│ │ │ └── runtime
│ │ │ ├── TestRewriteRuleTokenStream
│ │ │ ├── TestRewriteRuleTokenStream.h
│ │ │ └── TestRewriteRuleTokenStream.m
│ │ │ ├── misc
│ │ │ ├── FastQueueTest.h
│ │ │ ├── FastQueueTest.m
│ │ │ ├── IntArrayTest.h
│ │ │ ├── IntArrayTest.m
│ │ │ ├── TestDictionary.h
│ │ │ └── TestDictionary.m
│ │ │ ├── recognizer
│ │ │ ├── RecognizerTest.h
│ │ │ └── RecognizerTest.m
│ │ │ ├── sets
│ │ │ ├── ANTLRBitSetTest.h
│ │ │ └── ANTLRBitSetTest.m
│ │ │ ├── stream
│ │ │ ├── ANTLRStringStreamTest.h
│ │ │ └── ANTLRStringStreamTest.m
│ │ │ ├── token
│ │ │ ├── CommonTokenTest.h
│ │ │ └── CommonTokenTest.m
│ │ │ └── tree
│ │ │ ├── CommonErrorNodeTest.h
│ │ │ ├── CommonErrorNodeTest.m
│ │ │ ├── CommonTreeAdaptorTest.h
│ │ │ ├── CommonTreeAdaptorTest.m
│ │ │ ├── CommonTreeTest.h
│ │ │ └── CommonTreeTest.m
│ └── README
├── Perl5
│ ├── .p4ignore
│ ├── Build.PL
│ ├── Changes
│ ├── INSTALL
│ ├── MANIFEST
│ ├── MANIFEST.SKIP
│ ├── Makefile.PL
│ ├── README
│ ├── docs
│ │ └── design.pod
│ ├── examples
│ │ ├── README
│ │ ├── expr
│ │ │ ├── Expr.g
│ │ │ └── expr.pl
│ │ ├── id
│ │ │ ├── IDLexer.g
│ │ │ └── id.pl
│ │ ├── mexpr
│ │ │ ├── MExpr.g
│ │ │ └── mexpr.pl
│ │ ├── simplecalc
│ │ │ ├── SimpleCalc.g
│ │ │ └── simplecalc.pl
│ │ ├── tweak
│ │ │ ├── T.g
│ │ │ ├── input
│ │ │ ├── output
│ │ │ └── tweak.pl
│ │ └── zero-one
│ │ │ ├── T.g
│ │ │ ├── t-error.pl
│ │ │ └── t.pl
│ ├── lib
│ │ └── ANTLR
│ │ │ ├── Runtime.pm
│ │ │ └── Runtime
│ │ │ ├── ANTLRFileStream.pm
│ │ │ ├── ANTLRStringStream.pm
│ │ │ ├── BaseRecognizer.pm
│ │ │ ├── BitSet.pm
│ │ │ ├── CharStream.pm
│ │ │ ├── CharStreamState.pm
│ │ │ ├── CommonToken.pm
│ │ │ ├── CommonTokenStream.pm
│ │ │ ├── DFA.pm
│ │ │ ├── EarlyExitException.pm
│ │ │ ├── Exception.pm
│ │ │ ├── IntStream.pm
│ │ │ ├── Lexer.pm
│ │ │ ├── MismatchedSetException.pm
│ │ │ ├── MismatchedTokenException.pm
│ │ │ ├── MissingTokenException.pm
│ │ │ ├── NoViableAltException.pm
│ │ │ ├── Parser.pm
│ │ │ ├── ParserRuleReturnScope.pm
│ │ │ ├── RecognitionException.pm
│ │ │ ├── RecognizerSharedState.pm
│ │ │ ├── RuleReturnScope.pm
│ │ │ ├── Stream.pm
│ │ │ ├── Token.pm
│ │ │ ├── TokenSource.pm
│ │ │ ├── TokenStream.pm
│ │ │ └── UnwantedTokenException.pm
│ ├── port.yml
│ ├── t
│ │ ├── author
│ │ │ ├── api.t
│ │ │ ├── perlcritic.t
│ │ │ ├── perlcriticrc
│ │ │ ├── pod-coverage.t
│ │ │ └── pod.t
│ │ ├── classes.t
│ │ ├── classes
│ │ │ └── Test
│ │ │ │ └── ANTLR
│ │ │ │ └── Runtime
│ │ │ │ ├── ANTLRStringStream.pm
│ │ │ │ ├── BitSet.pm
│ │ │ │ ├── CommonToken.pm
│ │ │ │ ├── Exception.pm
│ │ │ │ └── Lexer.pm
│ │ ├── examples
│ │ │ ├── expr.t
│ │ │ ├── fig.t
│ │ │ └── simplecalc.t
│ │ ├── lexer.t
│ │ ├── lib
│ │ │ ├── ANTLR
│ │ │ │ └── Runtime
│ │ │ │ │ └── Test.pm
│ │ │ └── My
│ │ │ │ └── Test
│ │ │ │ ├── Class.pm
│ │ │ │ └── Class
│ │ │ │ └── Load.pm
│ │ └── version.t
│ └── tools
│ │ ├── antlr.bat
│ │ ├── antlr.sh
│ │ └── port.pl
├── Python
│ ├── AUTHORS
│ ├── ChangeLog
│ ├── LICENSE
│ ├── MANIFEST.in
│ ├── README
│ ├── TODO
│ ├── antlr3
│ │ ├── __init__.py
│ │ ├── compat.py
│ │ ├── constants.py
│ │ ├── debug.py
│ │ ├── dfa.py
│ │ ├── dottreegen.py
│ │ ├── exceptions.py
│ │ ├── extras.py
│ │ ├── main.py
│ │ ├── recognizers.py
│ │ ├── streams.py
│ │ ├── tokens.py
│ │ ├── tree.py
│ │ └── treewizard.py
│ ├── dist
│ │ ├── antlr_python_runtime-3.4-py2.4.egg
│ │ ├── antlr_python_runtime-3.4-py2.6.egg
│ │ ├── antlr_python_runtime-3.4.tar.gz
│ │ └── antlr_python_runtime-3.4.zip
│ ├── doxyfile
│ ├── ez_setup.py
│ ├── hudson-build.sh
│ ├── mkdoxy.sh
│ ├── pylintrc
│ ├── setup.py
│ ├── tests
│ │ ├── t001lexer.g
│ │ ├── t001lexer.py
│ │ ├── t002lexer.g
│ │ ├── t002lexer.py
│ │ ├── t003lexer.g
│ │ ├── t003lexer.py
│ │ ├── t004lexer.g
│ │ ├── t004lexer.py
│ │ ├── t005lexer.g
│ │ ├── t005lexer.py
│ │ ├── t006lexer.g
│ │ ├── t006lexer.py
│ │ ├── t007lexer.g
│ │ ├── t007lexer.py
│ │ ├── t008lexer.g
│ │ ├── t008lexer.py
│ │ ├── t009lexer.g
│ │ ├── t009lexer.py
│ │ ├── t010lexer.g
│ │ ├── t010lexer.py
│ │ ├── t011lexer.g
│ │ ├── t011lexer.py
│ │ ├── t012lexerXML.input
│ │ ├── t012lexerXML.output
│ │ ├── t012lexerXML.py
│ │ ├── t012lexerXMLLexer.g
│ │ ├── t013parser.g
│ │ ├── t013parser.py
│ │ ├── t014parser.g
│ │ ├── t014parser.py
│ │ ├── t015calc.g
│ │ ├── t015calc.py
│ │ ├── t016actions.g
│ │ ├── t016actions.py
│ │ ├── t017parser.g
│ │ ├── t017parser.py
│ │ ├── t018llstar.g
│ │ ├── t018llstar.input
│ │ ├── t018llstar.output
│ │ ├── t018llstar.py
│ │ ├── t019lexer.g
│ │ ├── t019lexer.input
│ │ ├── t019lexer.py
│ │ ├── t020fuzzy.input
│ │ ├── t020fuzzy.output
│ │ ├── t020fuzzy.py
│ │ ├── t020fuzzyLexer.g
│ │ ├── t021hoist.g
│ │ ├── t021hoist.py
│ │ ├── t022scopes.g
│ │ ├── t022scopes.py
│ │ ├── t023scopes.g
│ │ ├── t023scopes.py
│ │ ├── t024finally.g
│ │ ├── t024finally.py
│ │ ├── t025lexerRulePropertyRef.g
│ │ ├── t025lexerRulePropertyRef.py
│ │ ├── t026actions.g
│ │ ├── t026actions.py
│ │ ├── t027eof.g
│ │ ├── t027eof.py
│ │ ├── t028labelExpr.g.disabled
│ │ ├── t029synpredgate.g
│ │ ├── t029synpredgate.py
│ │ ├── t030specialStates.g
│ │ ├── t030specialStates.py
│ │ ├── t031emptyAlt.g
│ │ ├── t031emptyAlt.py
│ │ ├── t032subrulePredict.g
│ │ ├── t032subrulePredict.py
│ │ ├── t033backtracking.g
│ │ ├── t033backtracking.py
│ │ ├── t034tokenLabelPropertyRef.g
│ │ ├── t034tokenLabelPropertyRef.py
│ │ ├── t035ruleLabelPropertyRef.g
│ │ ├── t035ruleLabelPropertyRef.py
│ │ ├── t036multipleReturnValues.g
│ │ ├── t036multipleReturnValues.py
│ │ ├── t037rulePropertyRef.g
│ │ ├── t037rulePropertyRef.py
│ │ ├── t038lexerRuleLabel.g
│ │ ├── t038lexerRuleLabel.py
│ │ ├── t039labels.g
│ │ ├── t039labels.py
│ │ ├── t040bug80.g
│ │ ├── t040bug80.py
│ │ ├── t041parameters.g
│ │ ├── t041parameters.py
│ │ ├── t042ast.g
│ │ ├── t042ast.py
│ │ ├── t043synpred.g
│ │ ├── t043synpred.py
│ │ ├── t044trace.g
│ │ ├── t044trace.py
│ │ ├── t045dfabug.g
│ │ ├── t045dfabug.py
│ │ ├── t046rewrite.g
│ │ ├── t046rewrite.py
│ │ ├── t047treeparser.g
│ │ ├── t047treeparser.py
│ │ ├── t047treeparserWalker.g
│ │ ├── t048rewrite.g
│ │ ├── t048rewrite.py
│ │ ├── t048rewrite2.g
│ │ ├── t049treeparser.py
│ │ ├── t050decorate.g
│ │ ├── t050decorate.py
│ │ ├── t051treeRewriteAST.py
│ │ ├── t052import.py
│ │ ├── t053hetero.py
│ │ ├── t054main.py
│ │ ├── t055templates.py
│ │ ├── t056lexer.py
│ │ ├── t057autoAST.py
│ │ ├── t058rewriteAST.py
│ │ ├── t059debug.py
│ │ ├── t060leftrecursion.py
│ │ └── testbase.py
│ ├── unittests
│ │ ├── testantlr3.py
│ │ ├── testbase.py
│ │ ├── testdfa.py
│ │ ├── testdottreegen.py
│ │ ├── testexceptions.py
│ │ ├── testrecognizers.py
│ │ ├── teststreams.input1
│ │ ├── teststreams.input2
│ │ ├── teststreams.py
│ │ ├── testtree.py
│ │ └── testtreewizard.py
│ └── xmlrunner.py
├── Python3
│ ├── .gitignore
│ ├── AUTHORS
│ ├── ChangeLog
│ ├── LICENSE
│ ├── README
│ ├── antlr3
│ │ ├── __init__.py
│ │ ├── constants.py
│ │ ├── debug.py
│ │ ├── dfa.py
│ │ ├── exceptions.py
│ │ ├── main.py
│ │ ├── recognizers.py
│ │ ├── streams.py
│ │ ├── tokens.py
│ │ ├── tree.py
│ │ └── treewizard.py
│ ├── doxyfile
│ ├── ez_setup.py
│ ├── mkdoxy.sh
│ ├── pylintrc
│ ├── setup.py
│ ├── tests
│ │ ├── t001lexer.g
│ │ ├── t001lexer.py
│ │ ├── t002lexer.g
│ │ ├── t002lexer.py
│ │ ├── t003lexer.g
│ │ ├── t003lexer.py
│ │ ├── t004lexer.g
│ │ ├── t004lexer.py
│ │ ├── t005lexer.g
│ │ ├── t005lexer.py
│ │ ├── t006lexer.g
│ │ ├── t006lexer.py
│ │ ├── t007lexer.g
│ │ ├── t007lexer.py
│ │ ├── t008lexer.g
│ │ ├── t008lexer.py
│ │ ├── t009lexer.g
│ │ ├── t009lexer.py
│ │ ├── t010lexer.g
│ │ ├── t010lexer.py
│ │ ├── t011lexer.g
│ │ ├── t011lexer.py
│ │ ├── t012lexerXML.input
│ │ ├── t012lexerXML.output
│ │ ├── t012lexerXML.py
│ │ ├── t012lexerXMLLexer.g
│ │ ├── t013parser.g
│ │ ├── t013parser.py
│ │ ├── t014parser.g
│ │ ├── t014parser.py
│ │ ├── t015calc.g
│ │ ├── t015calc.py
│ │ ├── t016actions.g
│ │ ├── t016actions.py
│ │ ├── t017parser.g
│ │ ├── t017parser.py
│ │ ├── t018llstar.g
│ │ ├── t018llstar.input
│ │ ├── t018llstar.output
│ │ ├── t018llstar.py
│ │ ├── t019lexer.g
│ │ ├── t019lexer.input
│ │ ├── t019lexer.py
│ │ ├── t020fuzzy.input
│ │ ├── t020fuzzy.output
│ │ ├── t020fuzzy.py
│ │ ├── t020fuzzyLexer.g
│ │ ├── t021hoist.g
│ │ ├── t021hoist.py
│ │ ├── t022scopes.g
│ │ ├── t022scopes.py
│ │ ├── t023scopes.g
│ │ ├── t023scopes.py
│ │ ├── t024finally.g
│ │ ├── t024finally.py
│ │ ├── t025lexerRulePropertyRef.g
│ │ ├── t025lexerRulePropertyRef.py
│ │ ├── t026actions.g
│ │ ├── t026actions.py
│ │ ├── t027eof.g
│ │ ├── t027eof.py
│ │ ├── t028labelExpr.g.disabled
│ │ ├── t029synpredgate.g
│ │ ├── t029synpredgate.py
│ │ ├── t030specialStates.g
│ │ ├── t030specialStates.py
│ │ ├── t031emptyAlt.g
│ │ ├── t031emptyAlt.py
│ │ ├── t032subrulePredict.g
│ │ ├── t032subrulePredict.py
│ │ ├── t033backtracking.g
│ │ ├── t033backtracking.py
│ │ ├── t034tokenLabelPropertyRef.g
│ │ ├── t034tokenLabelPropertyRef.py
│ │ ├── t035ruleLabelPropertyRef.g
│ │ ├── t035ruleLabelPropertyRef.py
│ │ ├── t036multipleReturnValues.g
│ │ ├── t036multipleReturnValues.py
│ │ ├── t037rulePropertyRef.g
│ │ ├── t037rulePropertyRef.py
│ │ ├── t038lexerRuleLabel.g
│ │ ├── t038lexerRuleLabel.py
│ │ ├── t039labels.g
│ │ ├── t039labels.py
│ │ ├── t040bug80.g
│ │ ├── t040bug80.py
│ │ ├── t041parameters.g
│ │ ├── t041parameters.py
│ │ ├── t042ast.g
│ │ ├── t042ast.py
│ │ ├── t043synpred.g
│ │ ├── t043synpred.py
│ │ ├── t044trace.g
│ │ ├── t044trace.py
│ │ ├── t045dfabug.g
│ │ ├── t045dfabug.py
│ │ ├── t046rewrite.g
│ │ ├── t046rewrite.py
│ │ ├── t047treeparser.g
│ │ ├── t047treeparser.py
│ │ ├── t047treeparserWalker.g
│ │ ├── t048rewrite.g
│ │ ├── t048rewrite.py
│ │ ├── t048rewrite2.g
│ │ ├── t049treeparser.py
│ │ ├── t050decorate.g
│ │ ├── t050decorate.py
│ │ ├── t051treeRewriteAST.py
│ │ ├── t052import.py
│ │ ├── t053hetero.py
│ │ ├── t054main.py
│ │ ├── t057autoAST.py
│ │ ├── t058rewriteAST.py
│ │ ├── t059debug.py
│ │ ├── t060leftrecursion.py
│ │ └── testbase.py
│ └── unittests
│ │ ├── testantlr3.py
│ │ ├── testbase.py
│ │ ├── testdfa.py
│ │ ├── testexceptions.py
│ │ ├── testrecognizers.py
│ │ ├── teststreams.input1
│ │ ├── teststreams.input2
│ │ ├── teststreams.py
│ │ ├── testtree.py
│ │ └── testtreewizard.py
└── Ruby
│ ├── ANTLR-LICENSE.txt
│ ├── History.txt
│ ├── README.txt
│ ├── lib
│ ├── antlr3.rb
│ └── antlr3
│ │ ├── constants.rb
│ │ ├── debug.rb
│ │ ├── debug
│ │ ├── event-hub.rb
│ │ ├── record-event-listener.rb
│ │ ├── rule-tracer.rb
│ │ ├── socket.rb
│ │ └── trace-event-listener.rb
│ │ ├── dfa.rb
│ │ ├── dot.rb
│ │ ├── error.rb
│ │ ├── main.rb
│ │ ├── modes
│ │ ├── ast-builder.rb
│ │ └── filter.rb
│ │ ├── profile.rb
│ │ ├── recognizers.rb
│ │ ├── streams.rb
│ │ ├── streams
│ │ ├── interactive.rb
│ │ └── rewrite.rb
│ │ ├── task.rb
│ │ ├── template.rb
│ │ ├── template
│ │ ├── group-file-lexer.rb
│ │ ├── group-file-parser.rb
│ │ ├── group-file.rb
│ │ └── parameter.rb
│ │ ├── test
│ │ ├── call-stack.rb
│ │ ├── core-extensions.rb
│ │ ├── functional.rb
│ │ └── grammar.rb
│ │ ├── token.rb
│ │ ├── tree.rb
│ │ ├── tree
│ │ ├── debug.rb
│ │ ├── visitor.rb
│ │ └── wizard.rb
│ │ ├── util.rb
│ │ └── version.rb
│ ├── rakefile
│ └── test
│ ├── functional
│ ├── ast-output
│ │ ├── auto-ast.rb
│ │ ├── construction.rb
│ │ ├── hetero-nodes.rb
│ │ ├── rewrites.rb
│ │ └── tree-rewrite.rb
│ ├── debugging
│ │ ├── debug-mode.rb
│ │ ├── profile-mode.rb
│ │ └── rule-tracing.rb
│ ├── delegation
│ │ └── import.rb
│ ├── lexer
│ │ ├── basic.rb
│ │ ├── filter-mode.rb
│ │ ├── nuances.rb
│ │ ├── properties.rb
│ │ ├── syn-pred.rb
│ │ └── xml.rb
│ ├── main
│ │ └── main-scripts.rb
│ ├── parser
│ │ ├── actions.rb
│ │ ├── backtracking.rb
│ │ ├── basic.rb
│ │ ├── calc.rb
│ │ ├── ll-star.rb
│ │ ├── nuances.rb
│ │ ├── predicates.rb
│ │ ├── properties.rb
│ │ ├── rule-methods.rb
│ │ └── scopes.rb
│ ├── template-output
│ │ └── template-output.rb
│ ├── token-rewrite
│ │ ├── basic.rb
│ │ └── via-parser.rb
│ └── tree-parser
│ │ └── basic.rb
│ └── unit
│ ├── sample-input
│ ├── file-stream-1
│ ├── template-group
│ └── teststreams.input2
│ ├── test-dfa.rb
│ ├── test-exceptions.rb
│ ├── test-recognizers.rb
│ ├── test-scheme.rb
│ ├── test-scope.rb
│ ├── test-streams.rb
│ ├── test-template.rb
│ ├── test-tree-wizard.rb
│ └── test-trees.rb
└── tool
├── CHANGES.txt
├── LICENSE.txt
├── antlr.config
├── pom.xml
└── src
├── BUILD.bazel
├── main
├── antlr3
│ └── org
│ │ └── antlr
│ │ └── grammar
│ │ └── v3
│ │ ├── ANTLR.g
│ │ ├── ANTLRTreePrinter.g
│ │ ├── ANTLRv3.g
│ │ ├── ANTLRv3Tree.g
│ │ ├── ActionAnalysis.g
│ │ ├── ActionTranslator.g
│ │ ├── AssignTokenTypesWalker.g
│ │ ├── CodeGenTreeWalker.g
│ │ ├── DefineGrammarItemsWalker.g
│ │ ├── LeftRecursiveRuleWalker.g
│ │ └── TreeToNFAConverter.g
├── java
│ └── org
│ │ └── antlr
│ │ ├── Tool.java
│ │ ├── analysis
│ │ ├── ActionLabel.java
│ │ ├── AnalysisRecursionOverflowException.java
│ │ ├── AnalysisTimeoutException.java
│ │ ├── DFA.java
│ │ ├── DFAOptimizer.java
│ │ ├── DFAState.java
│ │ ├── DecisionProbe.java
│ │ ├── LL1Analyzer.java
│ │ ├── LL1DFA.java
│ │ ├── Label.java
│ │ ├── LookaheadSet.java
│ │ ├── MachineProbe.java
│ │ ├── NFA.java
│ │ ├── NFAConfiguration.java
│ │ ├── NFAContext.java
│ │ ├── NFAConversionThread.java
│ │ ├── NFAState.java
│ │ ├── NFAToDFAConverter.java
│ │ ├── NonLLStarDecisionException.java
│ │ ├── PredicateLabel.java
│ │ ├── RuleClosureTransition.java
│ │ ├── SemanticContext.java
│ │ ├── State.java
│ │ ├── StateCluster.java
│ │ └── Transition.java
│ │ ├── codegen
│ │ ├── ACyclicDFACodeGenerator.java
│ │ ├── ActionScriptTarget.java
│ │ ├── CSharp2Target.java
│ │ ├── CSharp3Target.java
│ │ ├── CTarget.java
│ │ ├── CodeGenerator.java
│ │ ├── CppTarget.java
│ │ ├── DelphiTarget.java
│ │ ├── JavaScriptTarget.java
│ │ ├── JavaTarget.java
│ │ ├── ObjCTarget.java
│ │ ├── Perl5Target.java
│ │ ├── Python3Target.java
│ │ ├── PythonTarget.java
│ │ ├── RubyTarget.java
│ │ └── Target.java
│ │ ├── misc
│ │ ├── Barrier.java
│ │ ├── BitSet.java
│ │ ├── Graph.java
│ │ ├── IntArrayList.java
│ │ ├── IntSet.java
│ │ ├── Interval.java
│ │ ├── IntervalSet.java
│ │ ├── MultiMap.java
│ │ ├── MutableInteger.java
│ │ ├── OrderedHashSet.java
│ │ └── Utils.java
│ │ └── tool
│ │ ├── ANTLRErrorListener.java
│ │ ├── AssignTokenTypesBehavior.java
│ │ ├── Attribute.java
│ │ ├── AttributeScope.java
│ │ ├── BuildDependencyGenerator.java
│ │ ├── CompositeGrammar.java
│ │ ├── CompositeGrammarTree.java
│ │ ├── DOTGenerator.java
│ │ ├── ErrorManager.java
│ │ ├── FASerializer.java
│ │ ├── Grammar.java
│ │ ├── GrammarAST.java
│ │ ├── GrammarAnalysisAbortedMessage.java
│ │ ├── GrammarDanglingStateMessage.java
│ │ ├── GrammarInsufficientPredicatesMessage.java
│ │ ├── GrammarNonDeterminismMessage.java
│ │ ├── GrammarReport.java
│ │ ├── GrammarReport2.java
│ │ ├── GrammarSanity.java
│ │ ├── GrammarSemanticsMessage.java
│ │ ├── GrammarSerializerFoo.java
│ │ ├── GrammarSpelunker.java
│ │ ├── GrammarSyntaxMessage.java
│ │ ├── GrammarUnreachableAltsMessage.java
│ │ ├── Interp.java
│ │ ├── Interpreter.java
│ │ ├── LeftRecursionCyclesMessage.java
│ │ ├── LeftRecursiveRuleAnalyzer.java
│ │ ├── Message.java
│ │ ├── NFAFactory.java
│ │ ├── NameSpaceChecker.java
│ │ ├── NonRegularDecisionMessage.java
│ │ ├── RandomPhrase.java
│ │ ├── RecursionOverflowMessage.java
│ │ ├── Rule.java
│ │ ├── RuleLabelScope.java
│ │ ├── Strip.java
│ │ ├── ToolMessage.java
│ │ ├── ToolSTGroupFile.java
│ │ └── serialize.g
└── resources
│ └── org
│ └── antlr
│ ├── antlr.properties
│ ├── codegen
│ └── templates
│ │ ├── ActionScript
│ │ ├── AST.stg
│ │ ├── ASTParser.stg
│ │ ├── ASTTreeParser.stg
│ │ └── ActionScript.stg
│ │ ├── C
│ │ ├── AST.stg
│ │ ├── ASTDbg.stg
│ │ ├── ASTParser.stg
│ │ ├── ASTTreeParser.stg
│ │ ├── C.stg
│ │ └── Dbg.stg
│ │ ├── CSharp2
│ │ ├── AST.stg
│ │ ├── ASTDbg.stg
│ │ ├── ASTParser.stg
│ │ ├── ASTTreeParser.stg
│ │ ├── CSharp2.stg
│ │ ├── Dbg.stg
│ │ └── ST.stg
│ │ ├── CSharp3
│ │ ├── AST.stg
│ │ ├── ASTDbg.stg
│ │ ├── ASTParser.stg
│ │ ├── ASTTreeParser.stg
│ │ ├── CSharp3.stg
│ │ ├── Dbg.stg
│ │ └── ST.stg
│ │ ├── Cpp
│ │ └── Cpp.stg
│ │ ├── Delphi
│ │ ├── AST.stg
│ │ ├── ASTParser.stg
│ │ ├── ASTTreeParser.stg
│ │ └── Delphi.stg
│ │ ├── Java
│ │ ├── AST.stg
│ │ ├── ASTDbg.stg
│ │ ├── ASTParser.stg
│ │ ├── ASTTreeParser.stg
│ │ ├── Dbg.stg
│ │ ├── Java.stg
│ │ └── ST.stg
│ │ ├── JavaScript
│ │ ├── AST.stg
│ │ ├── ASTParser.stg
│ │ ├── ASTTreeParser.stg
│ │ └── JavaScript.stg
│ │ ├── LeftRecursiveRules.stg
│ │ ├── ObjC
│ │ ├── AST.stg
│ │ ├── ASTDbg.stg
│ │ ├── ASTParser.stg
│ │ ├── ASTTreeParser.stg
│ │ ├── Dbg.stg
│ │ ├── ObjC.stg
│ │ ├── ST.stg
│ │ └── ST4ObjC.stg
│ │ ├── Perl5
│ │ ├── ASTTreeParser.stg
│ │ └── Perl5.stg
│ │ ├── Python
│ │ ├── AST.stg
│ │ ├── ASTDbg.stg
│ │ ├── ASTParser.stg
│ │ ├── ASTTreeParser.stg
│ │ ├── Dbg.stg
│ │ ├── Python.stg
│ │ └── ST.stg
│ │ ├── Python3
│ │ ├── AST.stg
│ │ ├── ASTDbg.stg
│ │ ├── ASTParser.stg
│ │ ├── ASTTreeParser.stg
│ │ ├── Dbg.stg
│ │ ├── Python3.stg
│ │ └── ST.stg
│ │ ├── Ruby
│ │ ├── AST.stg
│ │ ├── ASTDbg.stg
│ │ ├── ASTParser.stg
│ │ ├── ASTTreeParser.stg
│ │ ├── Dbg.stg
│ │ ├── Ruby.stg
│ │ └── ST.stg
│ │ └── Scala
│ │ └── Scala.stg
│ └── tool
│ └── templates
│ ├── depend.stg
│ ├── dot
│ └── dot.stg
│ └── messages
│ ├── formats
│ ├── antlr.stg
│ ├── gnu.stg
│ └── vs2005.stg
│ └── languages
│ └── en.stg
└── test
└── java
└── org
└── antlr
└── test
├── BaseTest.java
├── DebugTestAutoAST.java
├── DebugTestCompositeGrammars.java
├── DebugTestRewriteAST.java
├── ErrorQueue.java
├── TestASTConstruction.java
├── TestAttributes.java
├── TestAutoAST.java
├── TestBufferedTreeNodeStream.java
├── TestCharDFAConversion.java
├── TestCommonTokenStream.java
├── TestCompositeGrammars.java
├── TestDFAConversion.java
├── TestDFAMatching.java
├── TestFastQueue.java
├── TestHeteroAST.java
├── TestInterpretedLexing.java
├── TestInterpretedParsing.java
├── TestIntervalSet.java
├── TestJavaCodeGeneration.java
├── TestLeftRecursion.java
├── TestLexer.java
├── TestMessages.java
├── TestNFAConstruction.java
├── TestRewriteAST.java
├── TestRewriteTemplates.java
├── TestSemanticPredicateEvaluation.java
├── TestSemanticPredicates.java
├── TestSets.java
├── TestSymbolDefinitions.java
├── TestSyntacticPredicateEvaluation.java
├── TestSyntaxErrors.java
├── TestTemplates.java
├── TestTokenRewriteStream.java
├── TestTopologicalSort.java
├── TestTreeGrammarRewriteAST.java
├── TestTreeIterator.java
├── TestTreeNodeStream.java
├── TestTreeParsing.java
├── TestTreeWizard.java
└── TestTrees.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # Maven build folders
2 | target/
3 |
4 | # IntelliJ project files
5 | *.iml
6 | *.ipr
7 | *.iws
8 | .idea/
9 |
10 | # Eclipse project files
11 | .project
12 | .classpath
13 | .settings/
14 |
15 | # NetBeans user configuration
16 | nbactions.xml
17 | nb-configuration.xml
18 |
19 | # Python runtime files
20 | *.py[co]
21 |
22 | # Bazel
23 | bazel-bin
24 | bazel-out
25 | bazel-antlr3
26 | bazel-testlogs
27 |
--------------------------------------------------------------------------------
/BUILD.txt:
--------------------------------------------------------------------------------
1 | We have moved instructions for building ANTLR with the maven build system to:
2 |
3 | http://www.antlr.org/wiki/display/ANTLR3/Building+ANTLR+with+Maven
4 |
5 | The notes are by Jim Idle (and are a bit out of date but we hope to
6 | update them).
7 |
--------------------------------------------------------------------------------
/antlr-ant/main/antlr3-task/antlr3-src/org/apache/tools/ant/antlr/ANTLR3.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr-ant/main/antlr3-task/antlr3-src/org/apache/tools/ant/antlr/ANTLR3.java
--------------------------------------------------------------------------------
/antlr-ant/main/antlr3-task/antlr3-src/org/apache/tools/ant/antlr/antlib.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/antlr-ant/main/antlr3-task/antlr3-task.doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr-ant/main/antlr3-task/antlr3-task.doc
--------------------------------------------------------------------------------
/antlr-ant/main/antlr3-task/antlr3-task.htm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr-ant/main/antlr3-task/antlr3-task.htm
--------------------------------------------------------------------------------
/antlr-ant/main/antlr3-task/antlr3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr-ant/main/antlr3-task/antlr3.jar
--------------------------------------------------------------------------------
/antlr-ant/main/antlr3-task/composite-java_build.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr-ant/main/antlr3-task/composite-java_build.zip
--------------------------------------------------------------------------------
/antlr-ant/main/antlr3-task/composite-netbeans.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr-ant/main/antlr3-task/composite-netbeans.zip
--------------------------------------------------------------------------------
/antlr-ant/main/antlr3-task/d2u.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr-ant/main/antlr3-task/d2u.zip
--------------------------------------------------------------------------------
/antlr-ant/main/antlr3-task/polydiff-netbeans.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr-ant/main/antlr3-task/polydiff-netbeans.zip
--------------------------------------------------------------------------------
/antlr-ant/main/antlr3-task/polydiff_build.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr-ant/main/antlr3-task/polydiff_build.zip
--------------------------------------------------------------------------------
/antlr-ant/main/antlr3-task/simplecTreeParser.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr-ant/main/antlr3-task/simplecTreeParser.zip
--------------------------------------------------------------------------------
/antlr-complete/antlr.config:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr-complete/antlr.config
--------------------------------------------------------------------------------
/antlr.config:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr.config
--------------------------------------------------------------------------------
/antlr3-maven-archetype/antlr.config:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr3-maven-archetype/antlr.config
--------------------------------------------------------------------------------
/antlr3-maven-archetype/src/main/resources/archetype-resources/src/main/antlr3/imports/Ruleb.g:
--------------------------------------------------------------------------------
1 | // A single rule in a grammar that must be imported by the demo
2 | // parser Tparser.g
3 | // This is just here to show that import grammars are stored in their
4 | // own imports directory: src/main/antlr3/imports
5 | //
6 | parser grammar Ruleb;
7 |
8 | b
9 | : keyser SEMI!
10 | | expression SEMI!
11 | ;
12 |
--------------------------------------------------------------------------------
/antlr3-maven-plugin/antlr.config:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/antlr3-maven-plugin/antlr.config
--------------------------------------------------------------------------------
/antlr3-maven-plugin/src/site/apt/examples/import.apt:
--------------------------------------------------------------------------------
1 | Imported Grammar Files
2 |
3 | In order to have the ANTLR plugin automatically locate and use grammars used
4 | as imports in your main <<<.g>>> files, you need to place the imported grammar
5 | files in the imports directory beneath the root directory of your grammar
6 | files (which is <<>> by default of course).
7 |
8 | For a default layout, place your import grammars in the directory: <<>>
9 |
--------------------------------------------------------------------------------
/antlr3-maven-plugin/src/site/apt/faq.apt.vm:
--------------------------------------------------------------------------------
1 | FAQ
2 |
--------------------------------------------------------------------------------
/gunit-maven-plugin/antlr.config:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit-maven-plugin/antlr.config
--------------------------------------------------------------------------------
/gunit/antlr.config:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/antlr.config
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/gunit.stg:
--------------------------------------------------------------------------------
1 | group gunit;
2 |
3 | gUnitFile(testSuite) ::= <;
4 |
5 |
6 | >>
7 |
8 | testGroup() ::= <<
9 |
10 |
11 | //-------------------
12 | :
13 |
14 |
15 |
16 |
17 | >>
18 |
19 | testCase() ::= " "
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/accept.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/accept.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/add.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/addfile24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/addfile24.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/delete24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/delete24.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/edit16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/edit16.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/favb16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/favb16.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/favb24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/favb24.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/file16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/file16.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/filesearch24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/filesearch24.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/floppy24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/floppy24.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/folder24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/folder24.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/help24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/help24.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/next24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/next24.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/redo24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/redo24.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/refresh24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/refresh24.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/runfail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/runfail.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/runpass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/runpass.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/saveas24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/saveas24.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/testgroup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/testgroup.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/testgroupx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/testgroupx.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/testsuite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/testsuite.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/textfile16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/textfile16.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/textfile24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/textfile24.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/undo24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/undo24.png
--------------------------------------------------------------------------------
/gunit/src/main/resources/org/antlr/gunit/swingui/images/windowb16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/gunit/src/main/resources/org/antlr/gunit/swingui/images/windowb16.png
--------------------------------------------------------------------------------
/runtime/ActionScript/AUTHORS:
--------------------------------------------------------------------------------
1 | George Scott : Main developer of ActionScript target.
2 |
--------------------------------------------------------------------------------
/runtime/ActionScript/lib/antlr3.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/ActionScript/lib/antlr3.swc
--------------------------------------------------------------------------------
/runtime/ActionScript/project/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | #Tue Dec 11 16:01:13 PST 2007
2 | eclipse.preferences.version=1
3 | encoding/=utf-8
4 |
--------------------------------------------------------------------------------
/runtime/ActionScript/project/lib/FlexAntTasks.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/ActionScript/project/lib/FlexAntTasks.jar
--------------------------------------------------------------------------------
/runtime/ActionScript/project/lib/FlexUnitOptional.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/ActionScript/project/lib/FlexUnitOptional.swc
--------------------------------------------------------------------------------
/runtime/ActionScript/project/lib/flexunit.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/ActionScript/project/lib/flexunit.swc
--------------------------------------------------------------------------------
/runtime/ActionScript/project/src/org/antlr/runtime/CharStreamConstants.as:
--------------------------------------------------------------------------------
1 | package org.antlr.runtime
2 | {
3 | public class CharStreamConstants
4 | {
5 | public static const EOF:int = -1;
6 | }
7 | }
--------------------------------------------------------------------------------
/runtime/ActionScript/project/src/org/antlr/runtime/tree/TreeConstants.as:
--------------------------------------------------------------------------------
1 | package org.antlr.runtime.tree
2 | {
3 | import org.antlr.runtime.TokenConstants;
4 |
5 | public class TreeConstants {
6 | public static const INVALID_NODE:CommonTree = CommonTree.createFromToken(TokenConstants.INVALID_TOKEN);
7 | }
8 | }
--------------------------------------------------------------------------------
/runtime/ActionScript/project/src/org/antlr/runtime/version.as:
--------------------------------------------------------------------------------
1 | package org.antlr.runtime {
2 | public const version:String = "3.1.3.2";
3 | }
4 |
--------------------------------------------------------------------------------
/runtime/ActionScript/project/test/org/antlr/runtime/test/AllTests.as:
--------------------------------------------------------------------------------
1 | package org.antlr.runtime.test {
2 | import flexunit.framework.TestSuite;
3 |
4 |
5 | public class AllTests extends TestSuite {
6 |
7 | public function AllTests() {
8 | addTest(new TestSuite(TestANTLRStringStream));
9 | addTest(new TestSuite(TestBitSet));
10 | addTest(new TestSuite(TestDFA));
11 | }
12 |
13 | }
14 | }
--------------------------------------------------------------------------------
/runtime/C/C.vssscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
10 | }
11 |
--------------------------------------------------------------------------------
/runtime/C/NEWS:
--------------------------------------------------------------------------------
1 | See www.antlr.org and the associated email forums for release dates and
2 | other announcements.
3 |
--------------------------------------------------------------------------------
/runtime/C/dist/libantlr3c-3.1.4-SNAPSHOT.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/C/dist/libantlr3c-3.1.4-SNAPSHOT.tar.gz
--------------------------------------------------------------------------------
/runtime/C/dist/libantlr3c-3.3.1-SNAPSHOT.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/C/dist/libantlr3c-3.3.1-SNAPSHOT.tar.gz
--------------------------------------------------------------------------------
/runtime/C/dist/libantlr3c-3.4-beta3.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/C/dist/libantlr3c-3.4-beta3.tar.gz
--------------------------------------------------------------------------------
/runtime/C/doxygen/knownissues.dox:
--------------------------------------------------------------------------------
1 | /// \page knownissues Known Issues
2 | ///
3 | /// The following issues
--------------------------------------------------------------------------------
/runtime/C/m4/dummy:
--------------------------------------------------------------------------------
1 | Here to make sure autoconf does not screw up
2 |
--------------------------------------------------------------------------------
/runtime/CSharp2/Libraries/MbUnit/MbUnit.Framework.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/CSharp2/Libraries/MbUnit/MbUnit.Framework.dll
--------------------------------------------------------------------------------
/runtime/CSharp2/Libraries/MbUnit/MbUnit.MSBuild.Tasks.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/CSharp2/Libraries/MbUnit/MbUnit.MSBuild.Tasks.dll
--------------------------------------------------------------------------------
/runtime/CSharp2/Libraries/MbUnit/MbUnit.Tasks.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/CSharp2/Libraries/MbUnit/MbUnit.Tasks.dll
--------------------------------------------------------------------------------
/runtime/CSharp2/Libraries/MbUnit/QuickGraph.Algorithms.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/CSharp2/Libraries/MbUnit/QuickGraph.Algorithms.dll
--------------------------------------------------------------------------------
/runtime/CSharp2/Libraries/MbUnit/QuickGraph.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/CSharp2/Libraries/MbUnit/QuickGraph.dll
--------------------------------------------------------------------------------
/runtime/CSharp2/Libraries/StringTemplate.NET/net-2.0/StringTemplate.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/CSharp2/Libraries/StringTemplate.NET/net-2.0/StringTemplate.dll
--------------------------------------------------------------------------------
/runtime/CSharp2/Libraries/StringTemplate.NET/net-2.0/antlr.runtime.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/CSharp2/Libraries/StringTemplate.NET/net-2.0/antlr.runtime.dll
--------------------------------------------------------------------------------
/runtime/CSharp2/Sources/Antlr3_KeyPair.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/CSharp2/Sources/Antlr3_KeyPair.snk
--------------------------------------------------------------------------------
/runtime/CSharp2/Sources/Antlr3_PublicKey.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/CSharp2/Sources/Antlr3_PublicKey.snk
--------------------------------------------------------------------------------
/runtime/CSharp2/dist/DOT-NET-runtime-3.1.3.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/CSharp2/dist/DOT-NET-runtime-3.1.3.zip
--------------------------------------------------------------------------------
/runtime/Cpp/include/antlr3.inl:
--------------------------------------------------------------------------------
1 | ANTLR_BEGIN_NAMESPACE()
2 |
3 | //static
4 | ANTLR_INLINE void GenericStream::displayRecognitionError( const StringType& str )
5 | {
6 | fprintf(stderr, str.c_str() );
7 | }
8 |
9 | ANTLR_END_NAMESPACE()
--------------------------------------------------------------------------------
/runtime/Cpp/tests/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows test files
2 | [st][0-9][0-9][0-9].exe
3 |
4 | # Unix test files
5 | [st[0-9][0-9][0-9]
6 |
7 | # ANTLR generated files
8 | [st][0-9][0-9][0-9]?*.cpp
9 | [st][0-9][0-9][0-9]?*.hpp
10 | [st][0-9][0-9][0-9]*.tokens
11 |
12 | # MSVC files
13 | *.vcxproj
14 | *.vcxproj.user
15 | Debug/
16 | Release/
17 |
18 | # Eclipse CDT files
19 | .cproject
20 |
21 | # tests output files
22 | t012.lxr.output
23 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t001lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t001lexer;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | ZERO: '0';
14 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t002lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t002lexer;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | ZERO: '0';
14 | ONE: '1';
15 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t003lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t003lexer;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | ZERO: '0';
14 | ONE: '1';
15 | FOOZE: 'fooze';
16 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t004lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t004lexer;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | FOO: 'f' f=OO;
14 |
15 | fragment
16 | OO: 'o'*;
17 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t005lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t005lexer;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | FOO: 'f' 'o'+;
14 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t006lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t006lexer;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | FOO: 'f' ('o' | 'a')*;
14 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t007lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t007lexer;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | FOO: 'f' ('o' | 'a' 'b'+)*;
14 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t008lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t008lexer;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | FOO: 'f' 'a'?;
14 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t009lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t009lexer;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | DIGIT: '0' .. '9';
14 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t010lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t010lexer;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | IDENTIFIER: ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*;
14 | WS: (' ' | '\n')+;
15 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t012lexerXML.input:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
10 | ]>
11 |
12 |
13 | Text
14 |
15 | öäüß
16 | &
17 | <
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t027eof.g:
--------------------------------------------------------------------------------
1 | lexer grammar t027eof;
2 |
3 | options {
4 | language=Cpp;
5 | }
6 |
7 | @lexer::includes
8 | {
9 | #include "UserTestTraits.hpp"
10 | }
11 | @lexer::namespace
12 | { Antlr3Test }
13 |
14 | END: EOF;
15 | SPACE: ' ';
16 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t029synpredgate.g:
--------------------------------------------------------------------------------
1 | lexer grammar t029synpredgate;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | FOO
14 | : ('ab')=> A
15 | | ('ac')=> B
16 | ;
17 |
18 | fragment
19 | A: 'a';
20 |
21 | fragment
22 | B: 'a';
23 |
24 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t032subrulePredict.g:
--------------------------------------------------------------------------------
1 | grammar t032subrulePredict;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | @parser::includes {
14 | #include "UserTestTraits.hpp"
15 | }
16 | @parser::namespace
17 | { Antlr3Test }
18 |
19 | a: 'BEGIN' b WS+ 'END';
20 | b: ( WS+ 'A' )+;
21 | WS: ' ';
22 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t040bug80.g:
--------------------------------------------------------------------------------
1 | lexer grammar t040bug80;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | ID_LIKE
14 | : 'defined'
15 | | {False}? Identifier
16 | | Identifier
17 | ;
18 |
19 | fragment
20 | Identifier: 'a'..'z'+ ; // with just 'a', output compiles
21 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t043synpred.g:
--------------------------------------------------------------------------------
1 | grammar t043synpred;
2 | options {
3 | language =Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | @parser::includes {
14 | #include "UserTestTraits.hpp"
15 | }
16 | @parser::namespace
17 | { Antlr3Test }
18 |
19 | a: ((s+ P)=> s+ b)? E;
20 | b: P 'foo';
21 |
22 | s: S;
23 |
24 |
25 | S: ' ';
26 | P: '+';
27 | E: '>';
28 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t048rewrite.g:
--------------------------------------------------------------------------------
1 | lexer grammar t048rewrite;
2 | options {
3 | language=Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | A: 'a';
14 | B: 'b';
15 | C: 'c';
16 |
17 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t048rewrite2.g:
--------------------------------------------------------------------------------
1 | lexer grammar t048rewrite2;
2 | options {
3 | language=Cpp;
4 | }
5 |
6 | @lexer::includes
7 | {
8 | #include "UserTestTraits.hpp"
9 | }
10 | @lexer::namespace
11 | { Antlr3Test }
12 |
13 | ID : 'a'..'z'+;
14 | INT : '0'..'9'+;
15 | SEMI : ';';
16 | PLUS : '+';
17 | MUL : '*';
18 | ASSIGN : '=';
19 | WS : ' '+;
20 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t051.input:
--------------------------------------------------------------------------------
1 | 9.99
2 |
--------------------------------------------------------------------------------
/runtime/Cpp/tests/t051lexer.g:
--------------------------------------------------------------------------------
1 | // Lexer grammar using synpreds
2 | lexer grammar t051lexer;
3 |
4 | options {
5 | language=Cpp;
6 | }
7 |
8 | @lexer::includes
9 | {
10 | #include "UserTestTraits.hpp"
11 | }
12 | @lexer::namespace
13 | { Antlr3Test }
14 |
15 | fragment
16 | POINT
17 | : '.'
18 | ;
19 | NUMBER
20 | : ( ( NUM POINT NUM ) => NUM POINT NUM
21 | | POINT NUM
22 | | NUM
23 | )
24 | ;
25 | fragment
26 | NUM
27 | : '0' .. '9' ( '0' .. '9' )*
28 | ;
29 |
--------------------------------------------------------------------------------
/runtime/Delphi/Sources/Antlr3.Runtime.Tests/TestDriver.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/Delphi/Sources/Antlr3.Runtime.Tests/TestDriver.res
--------------------------------------------------------------------------------
/runtime/Java/antlr.config:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/Java/antlr.config
--------------------------------------------------------------------------------
/runtime/JavaScript/AUTHORS:
--------------------------------------------------------------------------------
1 | Joscha Feth : Contributor
2 | Joseph Hurst : Maintainer
3 | Jeff Saremi : Contributor
4 |
--------------------------------------------------------------------------------
/runtime/JavaScript/ChangeLog:
--------------------------------------------------------------------------------
1 | 0.0.1
2 | - First release!
3 |
--------------------------------------------------------------------------------
/runtime/JavaScript/build/license.txt:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2003-2008 Terence Parr. All rights reserved.
3 | Code licensed under the BSD License:
4 | http://www.antlr.org/license.html
5 |
6 | Some parts of the ANTLR class:
7 | Copyright (c) 2008, Yahoo! Inc. All rights reserved.
8 | Code licensed under the BSD License:
9 | http://developer.yahoo.net/yui/license.txt
10 | */
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/src/org/antlr/runtime/IndexOutOfBoundsExceptions.js:
--------------------------------------------------------------------------------
1 | org.antlr.runtime.IndexOutOfBoundsException = function(m) {
2 | org.antlr.runtime.IndexOutOfBoundsException.superclass.constructor.call(this, m);
3 | };
4 |
5 | org.antlr.lang.extend(org.antlr.runtime.IndexOutOfBoundsException, Error, {
6 | name: "org.antlr.runtime.IndexOutOfBoundsException"
7 | });
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/src/org/antlr/runtime/tree/TreeNodeStream.js:
--------------------------------------------------------------------------------
1 | /** A stream of tree nodes, accessing nodes from a tree of some kind */
2 | org.antlr.runtime.tree.TreeNodeStream = function() {};
3 |
4 | org.antlr.lang.extend(org.antlr.runtime.tree.TreeNodeStream,
5 | org.antlr.runtime.IntStream);
6 |
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t001lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t001lexer;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | ZERO: '0';
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t002lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t002lexer;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | ZERO: '0';
7 | ONE: '1';
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t003lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t003lexer;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | ZERO: '0';
7 | ONE: '1';
8 | FOOZE: 'fooze';
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t004lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t004lexer;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | FOO: 'f' 'o'*;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t005lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t005lexer;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | FOO: 'f' 'o'+;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t006lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t006lexer;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | FOO: 'f' ('o' | 'a')*;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t007lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t007lexer;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | FOO: 'f' ('o' | 'a' 'b'+)*;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t008lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t008lexer;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | FOO: 'f' 'a'?;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t009lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t009lexer;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | DIGIT: '0' .. '9';
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t010lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t010lexer;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | IDENTIFIER: ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*;
7 | WS: (' ' | '\n')+;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t011lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t011lexer;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | IDENTIFIER:
7 | ('a'..'z'|'A'..'Z'|'_')
8 | ('a'..'z'
9 | |'A'..'Z'
10 | |'0'..'9'
11 | |'_'
12 | {
13 | tlog("Underscore");
14 | tlog("foo");
15 | }
16 | )*
17 | ;
18 |
19 | WS: (' ' | '\n')+;
20 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t023scopes.g:
--------------------------------------------------------------------------------
1 | grammar t023scopes;
2 |
3 | options {
4 | language=JavaScript;
5 | }
6 |
7 | prog
8 | scope {
9 | name
10 | }
11 | : ID {$prog::name=$ID.text;}
12 | ;
13 |
14 | ID : ('a'..'z')+
15 | ;
16 |
17 | WS : (' '|'\n'|'\r')+ {$channel=org.antlr.runtime.BaseRecognizer.HIDDEN;}
18 | ;
19 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t024finally.g:
--------------------------------------------------------------------------------
1 | grammar t024finally;
2 |
3 | options {
4 | language=JavaScript;
5 | }
6 |
7 | prog returns [events]
8 | @init {events = [];}
9 | @after {events.push('after');}
10 | : ID {throw new Error("quux");}
11 | ;
12 | catch [e] {events.push('catch');}
13 | finally {events.push('finally');}
14 |
15 | ID : ('a'..'z')+
16 | ;
17 |
18 | WS : (' '|'\n'|'\r')+ {$channel=org.antlr.runtime.BaseRecognizer.HIDDEN}
19 | ;
20 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t025lexerRulePropertyRef.g:
--------------------------------------------------------------------------------
1 | lexer grammar t025lexerRulePropertyRef;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | @lexer::init {
7 | this.properties = [];
8 | }
9 |
10 | IDENTIFIER:
11 | ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*
12 | {
13 | this.properties.push(
14 | [$text, $type, $line, $pos, $index, $channel, $start, $stop]
15 | );
16 | }
17 | ;
18 | WS: (' ' | '\n')+;
19 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t027eof.g:
--------------------------------------------------------------------------------
1 | lexer grammar t027eof;
2 |
3 | options {
4 | language=JavaScript;
5 | }
6 |
7 | END: '\u0000';
8 | SPACE: ' ';
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t029synpredgate.g:
--------------------------------------------------------------------------------
1 | lexer grammar t029synpredgate;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | FOO
7 | : ('ab')=>A
8 | | ('ac')=>B
9 | ;
10 |
11 | fragment
12 | A: 'a';
13 |
14 | fragment
15 | B: 'a';
16 |
17 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t030specialStates.g:
--------------------------------------------------------------------------------
1 | grammar t030specialStates;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | @members {
7 | this.recover = function(input, re) {
8 | throw re;
9 | };
10 | }
11 |
12 | r
13 | : ( {this.cond}? NAME
14 | | {!this.cond}? NAME WS+ NAME
15 | )
16 | ( WS+ NAME )?
17 | EOF
18 | ;
19 |
20 | NAME: ('a'..'z') ('a'..'z' | '0'..'9')+;
21 | NUMBER: ('0'..'9')+;
22 | WS: ' '+;
23 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t031emptyAlt.g:
--------------------------------------------------------------------------------
1 | grammar t031emptyAlt;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | r
7 | : NAME
8 | ( {this.cond}?=> WS+ NAME
9 | |
10 | )
11 | EOF
12 | ;
13 |
14 | NAME: ('a'..'z') ('a'..'z' | '0'..'9')+;
15 | NUMBER: ('0'..'9')+;
16 | WS: ' '+;
17 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t032subrulePredict.g:
--------------------------------------------------------------------------------
1 | grammar t032subrulePredict;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | a: 'BEGIN' b WS+ 'END';
7 | b: ( WS+ 'A' )+;
8 | WS: ' ';
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t035ruleLabelPropertyRef.g:
--------------------------------------------------------------------------------
1 | grammar t035ruleLabelPropertyRef;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | a returns [bla]: t=b
7 | {
8 | $bla = [$t.start, $t.stop, $t.text];
9 | }
10 | ;
11 |
12 | b: A+;
13 |
14 | A: 'a'..'z';
15 |
16 | WS: ' '+ { $channel = HIDDEN; };
17 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t037rulePropertyRef.g:
--------------------------------------------------------------------------------
1 | grammar t037rulePropertyRef;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | a returns [bla]
7 | @after {
8 | $bla = [$start, $stop, $text];
9 | }
10 | : A+
11 | ;
12 |
13 | A: 'a'..'z';
14 |
15 | WS: ' '+ { $channel = HIDDEN };
16 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t039labels.g:
--------------------------------------------------------------------------------
1 | grammar t039labels;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | a returns [l]
7 | : ids+=A ( ',' ids+=(A|B) )* C D w=. ids+=. F EOF
8 | { l = [$ids, $w]; }
9 | ;
10 |
11 | A: 'a'..'z';
12 | B: '0'..'9';
13 | C: a='A';
14 | D: a='FOOBAR';
15 | E: 'GNU' a=.;
16 | F: 'BLARZ' a=EOF;
17 |
18 | WS: ' '+ { $channel = HIDDEN };
19 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t040bug80.g:
--------------------------------------------------------------------------------
1 | lexer grammar t040bug80;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | ID_LIKE
7 | : 'defined'
8 | | {false}? Identifier
9 | | Identifier
10 | ;
11 |
12 | fragment
13 | Identifier: 'a'..'z'+ ; // with just 'a', output compiles
14 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t041parameters.g:
--------------------------------------------------------------------------------
1 | grammar t041parameters;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | a[arg1, arg2] returns [l]
7 | : A+ EOF
8 | {
9 | l = [$arg1, $arg2];
10 | $arg1 = "gnarz";
11 | }
12 | ;
13 |
14 | A: 'a'..'z';
15 |
16 | WS: ' '+ { $channel = HIDDEN; };
17 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t043synpred.g:
--------------------------------------------------------------------------------
1 | grammar t043synpred;
2 | options {
3 | language = JavaScript;
4 | }
5 |
6 | a: ((s+ P)=> s+ b)? E;
7 | b: P 'foo';
8 |
9 | s: S;
10 |
11 |
12 | S: ' ';
13 | P: '+';
14 | E: '>';
15 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t044trace.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | grammar t044trace;
3 | options {
4 | language = JavaScript;
5 | }
6 |
7 | a: '<' ((INT '+')=>b|c) '>';
8 | b: c ('+' c)*;
9 | c: INT;
10 |
11 | INT: ('0'..'9')+;
12 | WS: (' ' | '\n' | '\t')+ {$channel = HIDDEN;};
13 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t048rewrite.g:
--------------------------------------------------------------------------------
1 | lexer grammar t048rewrite;
2 | options {
3 | language=JavaScript;
4 | }
5 |
6 | A: 'a';
7 | B: 'b';
8 | C: 'c';
9 |
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparsera.g:
--------------------------------------------------------------------------------
1 | grammar t049treeparsera;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparseraWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t049treeparseraWalker;
3 | options {
4 | language=JavaScript;
5 | ASTLabelType=CommonTree;
6 | }
7 | a : ID INT
8 | {this.capture($ID+", "+$INT);}
9 | ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparserb.g:
--------------------------------------------------------------------------------
1 | grammar t049treeparserb;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID INT);
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparserbWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t049treeparserbWalker;
3 | options {
4 | language=JavaScript;
5 | ASTLabelType=CommonTree;
6 | }
7 | a : ^(ID INT)
8 | {this.capture($ID+", "+$INT)}
9 | ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparserc.g:
--------------------------------------------------------------------------------
1 | grammar t049treeparserc;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : b c ;
7 | b : ID INT -> ^(ID INT);
8 | c : ID INT;
9 | ID : 'a'..'z'+ ;
10 | INT : '0'..'9'+;
11 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
12 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparsercWalker.g:
--------------------------------------------------------------------------------
1 | tree grammar t049treeparsercWalker;
2 | options {
3 | language=JavaScript;
4 | ASTLabelType=CommonTree;
5 | }
6 | a : b b ;
7 | b : ID INT {this.capture($ID+" "+$INT+"\n");}
8 | | ^(ID INT) {this.capture("^("+$ID+" "+$INT+")");}
9 | ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparserd.g:
--------------------------------------------------------------------------------
1 | grammar t049treeparserd;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : b c ;
7 | b : ID INT+ -> ^(ID INT+);
8 | c : ID INT+;
9 | ID : 'a'..'z'+ ;
10 | INT : '0'..'9'+;
11 | WS : (' '|'\n') {$channel=HIDDEN;} ;
12 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparserdWalker.g:
--------------------------------------------------------------------------------
1 | tree grammar t049treeparserdWalker;
2 | options {
3 | language=JavaScript;
4 | ASTLabelType=CommonTree;
5 | }
6 | a : b b ;
7 | b : ID INT+ {this.capture($ID+" "+$INT+"\n");}
8 | | ^(x=ID (y=INT)+) {this.capture("^("+$x+' '+$y+")");}
9 | ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparsere.g:
--------------------------------------------------------------------------------
1 | grammar t049treeparsere;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT+ PERIOD;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | SEMI : ';' ;
10 | PERIOD : '.' ;
11 | WS : (' '|'\n') {$channel=HIDDEN;} ;
12 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparsereWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t049treeparsereWalker;
3 | options {
4 | language=JavaScript;
5 | ASTLabelType=CommonTree;
6 | }
7 | a : ID INT+ PERIOD {this.capture("alt 1");}
8 | | ID INT+ SEMI {this.capture("alt 2");}
9 | ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparserf.g:
--------------------------------------------------------------------------------
1 | grammar t049treeparserf;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT? -> ^(ID INT?);
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparserfWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t049treeparserfWalker;
3 | options {
4 | language=JavaScript;
5 | ASTLabelType=CommonTree;
6 | }
7 | a : ^(ID INT?)
8 | {this.capture($ID);}
9 | ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparserg.g:
--------------------------------------------------------------------------------
1 | grammar t049treeparserg;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT? SEMI -> ^(ID INT?) SEMI ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | SEMI : ';' ;
10 | WS : (' '|'\n') {$channel=HIDDEN;} ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparsergWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t049treeparsergWalker;
3 | options {
4 | language=JavaScript;
5 | ASTLabelType=CommonTree;
6 | }
7 | a : ^(ID INT?) SEMI
8 | {this.capture($ID);}
9 | ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparserh.g:
--------------------------------------------------------------------------------
1 | grammar t049treeparserh;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : x=ID INT? (y=ID)? SEMI -> ^($x INT? $y?) SEMI ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | SEMI : ';' ;
10 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparserhWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t049treeparserhWalker;
3 | options {
4 | language=JavaScript;
5 | ASTLabelType=CommonTree;
6 | }
7 | a : ^(ID INT? b) SEMI
8 | {this.capture($ID+", "+$b.text);}
9 | ;
10 | b : ID? ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparseri.g:
--------------------------------------------------------------------------------
1 | grammar t049treeparseri;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : x=ID INT? SEMI -> ^($x INT?) ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | SEMI : ';' ;
10 | WS : (' '|'\n') {$channel=HIDDEN;} ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t049treeparseriWalker.g:
--------------------------------------------------------------------------------
1 | tree grammar t049treeparseriWalker;
2 | options {
3 | language=JavaScript;
4 | ASTLabelType=CommonTree;
5 | }
6 | a @init {var x=0;} : ^(ID {x=1;} {x=2;} INT?)
7 | {this.capture($ID+", "+x);}
8 | ;
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTa.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTa;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTaWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTaWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTa;
8 | }
9 |
10 | a : ID INT -> INT ID;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTaa.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTaa;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : 'boo' ID INT -> ^('boo' ^(ID INT)) ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTaaWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTaaWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTaa;
8 | rewrite=true;
9 | }
10 | tokens { X; }
11 | s : ^(a b) ; // s.tree is a.tree
12 | a : 'boo' ;
13 | b : ^(ID INT) -> INT
14 | ;
15 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTab.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTab;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID["root"] ^(ID INT)) | INT -> ^(ID["root"] INT) ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTabWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTabWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTab;
8 | rewrite=true;
9 | }
10 | s : ^(ID a) { this.buf += $s.start.toStringTree() };
11 | a : ^(ID INT) -> {true}? ^(ID["ick"] INT)
12 | -> INT
13 | ;
14 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTac.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTac;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID["root"] INT);
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTacWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTacWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTac;
8 | }
9 | s : ^(ID c=.) -> $c
10 | ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTb.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTb;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID INT);
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTbWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTbWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTb;
8 | }
9 | a : ^(ID INT) -> ^(INT ID);
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTc.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTc;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID INT) | INT ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTcWalker.g:
--------------------------------------------------------------------------------
1 | tree grammar t051treeRewriteASTcWalker;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | ASTLabelType=CommonTree;
6 | tokenVocab=t049treeparserc;
7 | }
8 | a : ^(ID INT) -> ^(INT ID) | INT;
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTd.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTd;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTdWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTdWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTd;
8 | }
9 |
10 | a : ID -> ^(ID ID);
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTe.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTe;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID+ INT+ -> (^(ID INT))+ ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTeWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTeWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTe;
8 | }
9 | a : (^(ID INT))+ -> INT+ ID+;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTf.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTf;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTfWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTfWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTf;
8 | }
9 | a: ID;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTg.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTg;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTgWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTgWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTg;
8 | }
9 | a : b c ;
10 | b : ID ;
11 | c : INT ;
12 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTh.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTh;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID ID INT ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASThWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASThWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTh;
8 | }
9 | a : ID ID INT ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTi.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTi;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID INT);
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTiWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTiWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTi;
8 | }
9 | a : ^(ID INT)
10 | ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTj.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTj;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID INT);
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTjWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTjWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTj;
8 | }
9 | a : ^(x=ID y=INT)
10 | ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTk.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTk;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID INT);
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTkWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTkWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTk;
8 | }
9 | a : ^(x=ID y=INT)
10 | ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTl.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTl;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID INT);
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTlWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTlWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTl;
8 | }
9 | a : ^(b INT) ;
10 | b : ID ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTm.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTm;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID INT);
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTmWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTmWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTm;
8 | }
9 | a : ^(x=b INT) ;
10 | b : ID ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTn.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTn;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID INT);
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTnWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTnWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTn;
8 | }
9 | a : ^(x+=b y+=c) ;
10 | b : ID ;
11 | c : INT ;
12 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTo.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTo;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : x=ID y=ID INT -> ^($x ^($y INT));
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASToWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASToWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTo;
8 | }
9 | a : ^(ID ^(ID INT))
10 | ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTp.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTp;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTpWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTpWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTp;
8 | }
9 | a : ID ->
10 | ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTq.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTq;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTqWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTqWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTq;
8 | }
9 | a : b INT;
10 | b : ID | INT;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTr.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTr;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : x=ID INT -> ^($x INT);
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTrWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTrWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTr;
8 | }
9 | a : ^(ID (ID | INT) ) ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTs.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTs;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : x=ID INT -> ^($x INT);
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTsWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTsWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTs;
8 | }
9 | a : ^((ID | INT) INT) ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTt.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTt;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID INT) | INT ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTtWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTtWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTt;
8 | rewrite=true;
9 | }
10 | a : ^(ID INT) -> ^(ID["ick"] INT)
11 | | INT // leaves it alone, returning $a.start
12 | ;
13 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTu.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTu;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ID INT | INT ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTuWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTuWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTu;
8 | rewrite=true;
9 | }
10 | s : ID a ;
11 | a : INT -> INT["1"]
12 | ;
13 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTv.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTv;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ID INT | INT ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTvWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTvWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTv;
8 | rewrite=true;
9 | }
10 | s : a ;
11 | a : b ;
12 | b : ID INT -> INT ID
13 | ;
14 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTw.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTw;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID INT) ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTwWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTwWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTw;
8 | rewrite=true;
9 | }
10 | s : a ;
11 | a : b ; // a.tree must become b.tree
12 | b : ^(ID INT) -> INT
13 | ;
14 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTx.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTx;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT -> ^(ID INT) ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTxWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTxWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTx;
8 | rewrite=true;
9 | }
10 | tokens { X; }
11 | s : a* b ; // only b contributes to tree, but it's after a*; s.tree = b.tree
12 | a : X ;
13 | b : ^(ID INT) -> INT
14 | ;
15 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTy.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTy;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : 'boo' ID INT -> 'boo' ^(ID INT) ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTyWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTyWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTy;
8 | rewrite=true;
9 | }
10 | tokens { X; }
11 | s : 'boo' a* b ; // don't reset s.tree to b.tree due to 'boo'
12 | a : X ;
13 | b : ^(ID INT) -> INT
14 | ;
15 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTz.g:
--------------------------------------------------------------------------------
1 | grammar t051treeRewriteASTz;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : 'boo' ID INT -> ^('boo' ^(ID INT)) ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t051treeRewriteASTzWalker.g:
--------------------------------------------------------------------------------
1 | // @@ANTLR Tool Options@@: -trace
2 | tree grammar t051treeRewriteASTzWalker;
3 | options {
4 | language=JavaScript;
5 | output=AST;
6 | ASTLabelType=CommonTree;
7 | tokenVocab=t051treeRewriteASTz;
8 | rewrite=true;
9 | }
10 | tokens { X; }
11 | s : ^('boo' a* b) ; // don't reset s.tree to b.tree due to 'boo'
12 | a : X ;
13 | b : ^(ID INT) -> INT
14 | ;
15 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importM1.g:
--------------------------------------------------------------------------------
1 | grammar t052importM1;
2 | options {
3 | language=JavaScript;
4 | }
5 | import t052importS1;
6 | s : a ;
7 | B : 'b' ; // defines B from inherited token space
8 | WS : (' '|'\n') {this.skip();} ;
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importM2.g:
--------------------------------------------------------------------------------
1 | grammar t052importM2;
2 | options {
3 | language=JavaScript;
4 | }
5 | import t052importS2;
6 | s : label=a[3] {this.capture($label.y);} ;
7 | B : 'b' ; // defines B from inherited token space
8 | WS : (' '|'\n') {this.skip();} ;
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importM3.g:
--------------------------------------------------------------------------------
1 | grammar t052importM3;
2 | options {
3 | language=JavaScript;
4 | }
5 | import t052importS3;
6 | s : 'b' {this.gt052importS3.foo();} ; // gS is import pointer
7 | WS : (' '|'\n') {this.skip();} ;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importM4.g:
--------------------------------------------------------------------------------
1 | grammar t052importM4;
2 | options {
3 | language=JavaScript;
4 | }
5 | import t052importS4, t052importT4;
6 | s : a ;
7 | B : 'b' ;
8 | WS : (' '|'\n') {this.skip();} ;
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importM5.g:
--------------------------------------------------------------------------------
1 | grammar t052importM5;
2 | options {
3 | language=JavaScript;
4 | }
5 | import t052importS5, t052importT5;
6 | s : x y ; // matches AA, which should be "aa"
7 | B : 'b' ; // another order: B, A, C
8 | A : 'a' ;
9 | C : 'c' ;
10 | WS : (' '|'\n') {this.skip();} ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importM6.g:
--------------------------------------------------------------------------------
1 | grammar t052importM6;
2 | options {
3 | language=JavaScript;
4 | }
5 | import t052importS6;
6 | b : 'b'|'c' ;
7 | WS : (' '|'\n') {this.skip();} ;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importM7.g:
--------------------------------------------------------------------------------
1 | lexer grammar t052importM7;
2 | options {
3 | language=JavaScript;
4 | }
5 | import t052importS7;
6 | B : 'b' ;
7 | WS : (' '|'\n') {this.skip();} ;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importM8.g:
--------------------------------------------------------------------------------
1 | lexer grammar t052importM8;
2 | options {
3 | language=JavaScript;
4 | }
5 | import t052importS8;
6 | A : 'a' {this.capture("M.A ");} ;
7 | WS : (' '|'\n') {this.skip();} ;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importS1.g:
--------------------------------------------------------------------------------
1 | parser grammar t052importS1;
2 | options {
3 | language=JavaScript;
4 | }
5 | @members {
6 | this.capture = function(t) {
7 | this.gt052importM1.capture(t);
8 | };
9 | }
10 |
11 | a : B { this.capture("S.a") } ;
12 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importS2.g:
--------------------------------------------------------------------------------
1 | parser grammar t052importS2;
2 | options {
3 | language=JavaScript;
4 | }
5 | @members {
6 | this.capture = function(t) {
7 | this.gt052importM2.capture(t);
8 | }
9 | }
10 | a[x] returns [y] : B {this.capture("S.a"); $y="1000";} ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importS3.g:
--------------------------------------------------------------------------------
1 | parser grammar t052importS3;
2 | options {
3 | language=JavaScript;
4 | }
5 | @members {
6 | this.capture = function(t) {
7 | this.gt052importM3.capture(t);
8 | };
9 | this.foo = function() {
10 | this.capture("foo");
11 | };
12 | }
13 |
14 | a : B ;
15 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importS4.g:
--------------------------------------------------------------------------------
1 | parser grammar t052importS4;
2 | options {
3 | language=JavaScript;
4 | }
5 | @members {
6 | this.capture = function(t) {
7 | this.gt052importM4.capture(t);
8 | };
9 | }
10 | a : b {this.capture("S.a");} ;
11 | b : B ;
12 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importS5.g:
--------------------------------------------------------------------------------
1 | parser grammar t052importS5;
2 | options {
3 | language=JavaScript;
4 | }
5 | tokens { A; B; C; }
6 | @members {
7 | this.capture = function(t) {
8 | this.gt052importM5.capture(t);
9 | };
10 | }
11 | x : A {this.capture("S.x ");} ;
12 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importS6.g:
--------------------------------------------------------------------------------
1 | parser grammar t052importS6;
2 | options {
3 | language=JavaScript;
4 | }
5 | @members {
6 | this.capture = function(t) {
7 | this.gt052importM6.capture(t);
8 | };
9 | }
10 | a : b { this.capture("S.a") } ;
11 | b : B ;
12 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importS7.g:
--------------------------------------------------------------------------------
1 | lexer grammar t052importS7;
2 | options {
3 | language=JavaScript;
4 | }
5 | @members {
6 | this.capture = function(t) {
7 | this.gt052importM7.capture(t);
8 | };
9 | }
10 | A : 'a' {this.capture("S.A ");} ;
11 | C : 'c' ;
12 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importS8.g:
--------------------------------------------------------------------------------
1 | lexer grammar t052importS8;
2 | options {
3 | language=JavaScript;
4 | }
5 | @members {
6 | this.capture = function(t) {
7 | this.gt052importM8.capture(t);
8 | };
9 | }
10 | A : 'a' {this.capture("S.A");} ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importT4.g:
--------------------------------------------------------------------------------
1 | parser grammar t052importT4;
2 | options {
3 | language=JavaScript;
4 | }
5 | @members {
6 | this.capture = function(t) {
7 | this.gt052importM4.capture(t);
8 | };
9 | }
10 | a : B {this.capture("T.a");} ; // hidden by S.a
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t052importT5.g:
--------------------------------------------------------------------------------
1 | parser grammar t052importT5;
2 | options {
3 | language=JavaScript;
4 | }
5 | tokens { C; B; A; } /// reverse order
6 | @members {
7 | this.capture = function(t) {
8 | this.gt052importM5.capture(t);
9 | };
10 | }
11 | y : A {this.capture("T.y");} ;
12 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID ';' ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT1.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT1;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | @header {
7 | function V() {
8 | V.superclass.constructor.apply(this, arguments);
9 | };
10 |
11 | org.antlr.lang.extend(V, org.antlr.runtime.tree.CommonTree, {
12 | toString: function() {
13 | return this.getText() + "";
14 | }
15 | });
16 | }
17 | a : ID ;
18 | ID : 'a'..'z'+ ;
19 | WS : (' '|'\n') {$channel=HIDDEN;} ;
20 |
21 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT13.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT13;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT14.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT14;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID INT;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT15.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT15;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT16.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT16;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT17.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT17;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT18.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT18;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | a : ID ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT2.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT2;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | @header {
7 | function V() {
8 | V.superclass.constructor.apply(this, arguments);
9 | };
10 |
11 | org.antlr.lang.extend(V, org.antlr.runtime.tree.CommonTree, {
12 | toString: function() {
13 | return this.getText() + "";
14 | }
15 | });
16 | }
17 | a : x=ID ;
18 | ID : 'a'..'z'+ ;
19 | WS : (' '|'\n') {$channel=HIDDEN;} ;
20 |
21 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT3.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT3;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | @header {
7 | function V() {
8 | V.superclass.constructor.apply(this, arguments);
9 | };
10 |
11 | org.antlr.lang.extend(V, org.antlr.runtime.tree.CommonTree, {
12 | toString: function() {
13 | return this.getText() + "";
14 | }
15 | });
16 | }
17 | a : x+=ID ;
18 | ID : 'a'..'z'+ ;
19 | WS : (' '|'\n') {$channel=HIDDEN;} ;
20 |
21 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT4.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT4;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | @header {
7 | function V() {
8 | V.superclass.constructor.apply(this, arguments);
9 | };
10 |
11 | org.antlr.lang.extend(V, org.antlr.runtime.tree.CommonTree, {
12 | toString: function() {
13 | return this.getText() + "";
14 | }
15 | });
16 | }
17 | a : ID^ ;
18 | ID : 'a'..'z'+ ;
19 | WS : (' '|'\n') {$channel=HIDDEN;} ;
20 |
21 |
22 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT5.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT5;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | @header {
7 | function V() {
8 | V.superclass.constructor.apply(this, arguments);
9 | };
10 |
11 | org.antlr.lang.extend(V, org.antlr.runtime.tree.CommonTree, {
12 | toString: function() {
13 | return this.getText() + "";
14 | }
15 | });
16 | }
17 | a : x+=ID^ ;
18 | ID : 'a'..'z'+ ;
19 | WS : (' '|'\n') {$channel=HIDDEN;} ;
20 |
21 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT6.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT6;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | @header {
7 | function V() {
8 | V.superclass.constructor.apply(this, arguments);
9 | };
10 |
11 | org.antlr.lang.extend(V, org.antlr.runtime.tree.CommonTree, {
12 | toString: function() {
13 | return this.getText() + "";
14 | }
15 | });
16 | }
17 | a : 'begin' ;
18 | ID : 'a'..'z'+ ;
19 | WS : (' '|'\n') {$channel=HIDDEN;} ;
20 |
21 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT7.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT7;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | @header {
7 | function V() {
8 | V.superclass.constructor.apply(this, arguments);
9 | };
10 |
11 | org.antlr.lang.extend(V, org.antlr.runtime.tree.CommonTree, {
12 | toString: function() {
13 | return this.getText() + "";
14 | }
15 | });
16 | }
17 | a : 'begin'^ ;
18 | ID : 'a'..'z'+ ;
19 | WS : (' '|'\n') {$channel=HIDDEN;} ;
20 |
21 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t053heteroT8.g:
--------------------------------------------------------------------------------
1 | grammar t053heteroT8;
2 | options {
3 | language=JavaScript;
4 | output=AST;
5 | }
6 | @header {
7 | function V() {
8 | V.superclass.constructor.apply(this, arguments);
9 | };
10 |
11 | org.antlr.lang.extend(V, org.antlr.runtime.tree.CommonTree, {
12 | toString: function() {
13 | return this.getText() + "";
14 | }
15 | });
16 | }
17 | a : ID -> ID ;
18 | ID : 'a'..'z'+ ;
19 | WS : (' '|'\n') {$channel=HIDDEN;} ;
20 |
21 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer1.g:
--------------------------------------------------------------------------------
1 | grammar t056lexer1;
2 | options {language=JavaScript;}
3 | a : A {this.xlog(this.input);} ;
4 | A : '\\' 't' {this.setText(" ");} ;
5 | WS : (' '|'\n') {$channel=HIDDEN;} ;
6 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer10.g:
--------------------------------------------------------------------------------
1 | grammar t056lexer10;
2 | options {language=JavaScript;}
3 | a : A ;
4 | A : i+=I WS i+=I {$channel=0; for (var p=0; p<$i.length; p++) this.xlog(" "+$i[p].getText()); } ;
5 | fragment I : '0'..'9'+ ;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer11.g:
--------------------------------------------------------------------------------
1 | grammar t056lexer11;
2 | options {language=JavaScript;}
3 | a : B ;
4 | B : x='a' {this.xlog($x);} ;
5 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer12.g:
--------------------------------------------------------------------------------
1 | lexer grammar t056lexer12;
2 | options {language=JavaScript;}
3 | B : x='a' x='b' ;
4 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer13.g:
--------------------------------------------------------------------------------
1 | lexer grammar t056lexer13;
2 | options {language=JavaScript;}
3 | B : x=A x=A ;
4 | fragment A : 'a' ;
5 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer14.g:
--------------------------------------------------------------------------------
1 | lexer grammar t056lexer14;
2 | options {language=JavaScript;}
3 | QUOTED_CONTENT
4 | : 'q' (~'q')* (('x' 'q') )* 'q' ;
5 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer15.g:
--------------------------------------------------------------------------------
1 | lexer grammar t056lexer15;
2 | options {language=JavaScript;}
3 | A : '\"' ;
4 | B : '\\\"' ;
5 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer2.g:
--------------------------------------------------------------------------------
1 | grammar t056lexer2;
2 | options {language=JavaScript;}
3 | a : A EOF {this.xlog(this.input);} ;
4 | A : '-' I ;
5 | I : '0'..'9'+ ;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer3.g:
--------------------------------------------------------------------------------
1 | grammar t056lexer3;
2 | options {language=JavaScript;}
3 | a : A EOF {this.xlog($A.text+", channel="+$A.channel);} ;
4 | A : '-' WS I ;
5 | I : '0'..'9'+ ;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer4.g:
--------------------------------------------------------------------------------
1 | grammar t056lexer4;
2 | options {language=JavaScript;}
3 | tokens {X;}
4 | a : X EOF {this.xlog(this.input);} ;
5 | A : '-' I {$type = this.X;} ;
6 | I : '0'..'9'+ ;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer5.g:
--------------------------------------------------------------------------------
1 | grammar t056lexer5;
2 | options {language=JavaScript;}
3 | a : A {this.xlog(this.input);} ;
4 | A : '-' I ;
5 | fragment I : '0'..'9'+ ;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer6.g:
--------------------------------------------------------------------------------
1 | grammar t056lexer6;
2 | options {language=JavaScript;}
3 | a : A EOF {this.xlog(this.input);} ;
4 | A : I '.' I ;
5 | fragment I : '0'..'9'+ ;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer7.g:
--------------------------------------------------------------------------------
1 | grammar t056lexer7;
2 | options {language=JavaScript;}
3 | a : A EOF ;
4 | A : 'hi' WS (v=I)? {$channel=0; this.xlog($v.text);} ;
5 | fragment I : '0'..'9'+ ;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer8.g:
--------------------------------------------------------------------------------
1 | grammar t056lexer8;
2 | options {language=JavaScript;}
3 | a : A EOF ;
4 | A : I {this.xlog($I.text);} ;
5 | fragment I : '0'..'9'+ ;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t056lexer9.g:
--------------------------------------------------------------------------------
1 | grammar t056lexer9;
2 | options {language=JavaScript;}
3 | a : A ;
4 | A : i+=I+ { for (var p=0; p<$i.length; p++) this.xlog(" "+$i[p].getText()); } ;
5 | fragment I : '0'..'9'+ ;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST1.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST1;
2 | options {language=JavaScript;output=AST;}
3 | a : ID INT ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;};
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST10.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST10;
2 | options {language=JavaScript;output=AST;}
3 | a : v='void' x=.^ ';' ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST11.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST11;
2 | options {language=JavaScript;output=AST;}
3 | a : v='void' x=.^ ';' ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST12.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST12;
2 | options {language=JavaScript;output=AST;}
3 | a : ID^ INT^ ID ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST13.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST13;
2 | options {language=JavaScript;output=AST;}
3 | a : ID INT^ ID^ ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST14.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST14;
2 | options {language=JavaScript;output=AST;}
3 | a : ID^ (INT '*'^ ID)+ ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST15.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST15;
2 | options {language=JavaScript;output=AST;}
3 | a : 'void' (({pass}ID|INT) ID | 'null' ) ';' ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST16.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST16;
2 | options {language=JavaScript;output=AST;}
3 | a : type ID ;
4 | type : {pass}'int' | 'float' ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST17.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST17;
2 | options {language=JavaScript;output=AST;}
3 | a : type^ ID ;
4 | type : {pass}'int' | 'float' ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST18.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST18;
2 | options {language=JavaScript;output=AST;}
3 | a : x=type^ ID ;
4 | type : {pass}'int' | 'float' ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST19.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST19;
2 | options {language=JavaScript;output=AST;}
3 | a : x+=type^ ID ;
4 | type : {pass}'int' | 'float' ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST2.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST2;
2 | options {language=JavaScript;output=AST;}
3 | a : (ID INT) ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST20.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST20;
2 | options {language=JavaScript;output=AST;}
3 | a : ID ('+'^ ID)* ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST21.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST21;
2 | options {language=JavaScript;output=AST;}
3 | a : ID (op^ ID)* ;
4 | op : {pass}'+' | '-' ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST22.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST22;
2 | options {language=JavaScript;output=AST;}
3 | s : a ;
4 | a : atom ('exp'^ a)? ;
5 | atom : INT ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST23.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST23;
2 | options {language=JavaScript;output=AST;}
3 | a : ID|INT ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST24.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST24;
2 | options {language=JavaScript;output=AST;}
3 | a : ('+' | '-')^ ID ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST25.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST25;
2 | options {language=JavaScript;output=AST;}
3 | a : x=('+' | '-')^ ID ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST26.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST26;
2 | options {language=JavaScript;output=AST;}
3 | a : ID (('+'|'-')^ ID)* ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST27.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST27;
2 | options {language=JavaScript;output=AST;}
3 | a : ~ID '+' INT ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST28.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST28;
2 | options {language=JavaScript;output=AST;}
3 | a : x=~ID '+' INT ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST29.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST29;
2 | options {language=JavaScript;output=AST;}
3 | a : x=~ID '+' INT ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST3.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST3;
2 | options {language=JavaScript;output=AST;}
3 | a : ID^ INT ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST30.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST30;
2 | options {language=JavaScript;output=AST;}
3 | a : ~'+'^ INT ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST31.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST31;
2 | options {language=JavaScript;output=AST;}
3 | a : ~'+'^ INT ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST32.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST32;
2 | options {language=JavaScript;output=AST;}
3 | a : ~'+'^ INT ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST33.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST33;
2 | options {language=JavaScript;output=AST;}
3 | a : INT (~INT^ INT)* ;
4 | blort : '+' ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST34.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST34;
2 | options {language=JavaScript;output=AST;}
3 | a returns [result] : id=ID id=ID {$result = "2nd id="+$id.text+";";} ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST35.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST35;
2 | options {language=JavaScript;output=AST;}
3 | a returns [result]: id=ID id=ID^ {$result = "2nd id="+$id.text+',';} ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST36.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST36;
2 | options {language=JavaScript;output=AST;}
3 | a returns [result] : ids+=ID ids+=ID {
4 | var p, buffer=[];
5 | for (p=0; p<$ids.length; p++) {
6 | buffer.push($ids[p]);
7 | }
8 | $result = "id list=["+buffer.join(",")+"],";
9 | } ;
10 | ID : 'a'..'z'+ ;
11 | INT : '0'..'9'+;
12 | WS : (' '|'\n') {$channel=HIDDEN;} ;
13 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST37.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST37;
2 | options {language=JavaScript;output=AST;}
3 | a returns [result] : ids+=ID^ ids+=ID {
4 | var p, buffer=[];
5 | for (p=0; p<$ids.length; p++) {
6 | buffer.push($ids[p]);
7 | }
8 | $result = "id list=["+buffer.join(",")+"],";
9 | } ;
10 | ID : 'a'..'z'+ ;
11 | INT : '0'..'9'+;
12 | WS : (' '|'\n') {$channel=HIDDEN;} ;
13 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST38.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST38;
2 | options {language=JavaScript;output=AST;}
3 | a : id+=ID^ ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST39.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST39;
2 | options {language=JavaScript;output=AST;}
3 | a : id+=ID! ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST4.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST4;
2 | options {language=JavaScript;output=AST;}
3 | a : INT ID^ ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST40.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST40;
2 | options {language=JavaScript;output=AST;}
3 | a returns [result]: x+=b x+=b {
4 | t=$x[1]
5 | $result = "2nd x="+t.toStringTree()+',';
6 | };
7 | b : ID;
8 | ID : 'a'..'z'+ ;
9 | INT : '0'..'9'+;
10 | WS : (' '|'\n') {$channel=HIDDEN;} ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST41.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST41;
2 | options {language=JavaScript;output=AST;}
3 | a returns [result] : ( x+=b^ )+ {
4 | $result = "x="+$x[1].toStringTree()+',';
5 | } ;
6 | b : ID;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST42.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST42;
2 | options {language=JavaScript;output=AST;}
3 | a returns [result] : x+=b! x+=b {
4 | $result = "1st x="+$x[0].toStringTree()+',';
5 | } ;
6 | b : ID;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST43.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST43;
2 | options {language=JavaScript;output=AST;}
3 | a : A b=B b=B c+=C c+=C D {s = $D.text} ;
4 | A : 'a' ;
5 | B : 'b' ;
6 | C : 'c' ;
7 | D : 'd' ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST44.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST44;
2 | options {language=JavaScript;output=AST;}
3 | a returns [result] : ID b {
4 | /* @todo */
5 | /* $result = $b.i.toString() + '\n'; */
6 | } ;
7 | b returns [i] : INT {$i=parseInt($INT.text);} ;
8 | ID : 'a'..'z'+ ;
9 | INT : '0'..'9'+;
10 | WS : (' '|'\n') {$channel=HIDDEN;} ;
11 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST45.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST45;
2 | options { language=JavaScript;output=AST; }
3 | r : (INT|ID)+ ;
4 | ID : 'a'..'z' + ;
5 | INT : '0'..'9' +;
6 | WS: (' ' | '\n' | '\\t')+ {$channel = HIDDEN;};
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST46.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST46;
2 | options {language=JavaScript;output=AST;}
3 | decl : type^ ID '='! INT ';'! ;
4 | type : 'int' | 'float' ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST47.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST47;
2 | options {language=JavaScript;output=AST;}
3 | tokens {EXPR;}
4 | decl : type^ ID '='! INT ';'! ;
5 | type : 'int' | 'float' ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST48.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST48;
2 | options {language=JavaScript;output=AST;}
3 | tokens {EXPR;}
4 | decl : type^ ID '='! INT ';'! ;
5 | type : 'int' | 'float' ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST49.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST49;
2 | options {language=JavaScript;output=AST;}
3 | a : ID INT ; // follow is EOF
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST5.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST5;
2 | options {language=JavaScript;output=AST;}
3 | a : ID INT! ID! INT ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST50.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST50;
2 | options {language=JavaScript;output=AST;}
3 | a : b ;
4 | b : ID INT ; // follow should see EOF
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
8 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST51.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST51;
2 | options {language=JavaScript;output=AST;}
3 | a : b c ;
4 | b : ID ;
5 | c : INT ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST52.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST52;
2 | options {language=JavaScript;output=AST;}
3 | a : ID INT ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST53.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST53;
2 | options {language=JavaScript;output=AST;}
3 | a : b c ;
4 | b : ID ;
5 | c : INT ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
9 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST54.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST54;
2 | options {language=JavaScript;output=AST;}
3 | a : b | c ;
4 | b : ID ;
5 | c : INT ;
6 | ID : 'a'..'z'+ ;
7 | S : '*' ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
10 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST6.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST6;
2 | options {language=JavaScript;output=AST;}
3 | a : ( ID INT )? ID^ ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST7.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST7;
2 | options {language=JavaScript;output=AST;}
3 | a : v='void'^ ID ';' ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST8.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST8;
2 | options {language=JavaScript;output=AST;}
3 | a : v='void'^ . ';' ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t057autoAST9.g:
--------------------------------------------------------------------------------
1 | grammar t057autoAST9;
2 | options {language=JavaScript;output=AST;}
3 | a : v='void' .^ ';' ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
7 |
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST1.g:
--------------------------------------------------------------------------------
1 | grammar t058rewriteAST1;
2 | options {language=JavaScript;output=AST;}
3 | a : ID INT -> ;
4 | ID : 'a'..'z'+ ;
5 | INT : '0'..'9'+;
6 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST10.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST10;
3 | options {language=JavaScript;output=AST;}
4 | a : b INT -> INT b;
5 | b : ID ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST11.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST11;
3 | options {language=JavaScript;output=AST;}
4 | a : ID INT -> ^(INT ID);
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST12.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST12;
3 | options {language=JavaScript;output=AST;}
4 | a : 'void' ID INT -> 'void' ^(INT ID);
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST13.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST13;
3 | options {language=JavaScript;output=AST;}
4 | tokens {DUH;}
5 | a : ID INT ID INT -> ^( DUH ID ^( DUH INT) )+ ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST14.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST14;
3 | options {language=JavaScript;output=AST;}
4 | a : ID -> ID? ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST15.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST15;
3 | options {language=JavaScript;output=AST;}
4 | a : ID ID -> ID* ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST16.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST16;
3 | options {language=JavaScript;output=AST;}
4 | a : ID ID -> ID+ ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST17.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST17;
3 | options {language=JavaScript;output=AST;}
4 | a : b -> b?;
5 | b : ID ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST18.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST18;
3 | options {language=JavaScript;output=AST;}
4 | a : b b -> b*;
5 | b : ID ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST19.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST19;
3 | options {language=JavaScript;output=AST;}
4 | a : x+=b x+=b -> $x*;
5 | b : ID ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST2.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST2;
3 | options {language=JavaScript;output=AST;}
4 | a : ID -> ID;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST20.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST20;
3 | options {language=JavaScript;output=AST;}
4 | a : (x=ID)? -> $x?;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST21.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST21;
3 | options {language=JavaScript;output=AST;}
4 | a : b b -> b+;
5 | b : ID ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST22.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST22;
3 | options {language=JavaScript;output=AST;}
4 | a : ID -> {true}? ID -> ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST23.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST23;
3 | options {language=JavaScript;output=AST;}
4 | a : ID -> {false}? ID -> ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST24.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST24;
3 | options {language=JavaScript;output=AST;}
4 | a : ID INT -> {false}? ID
5 | -> {true}? INT
6 | ->
7 | ;
8 | ID : 'a'..'z'+ ;
9 | INT : '0'..'9'+;
10 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST25.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST25;
3 | options {language=JavaScript;output=AST;}
4 | a : ID INT -> {false}? ^(ID INT)
5 | -> {true}? ^(INT ID)
6 | -> ID
7 | ;
8 | ID : 'a'..'z'+ ;
9 | INT : '0'..'9'+;
10 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST26.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST26;
3 | options {language=JavaScript;output=AST;}
4 | a : op INT -> ^(op INT);
5 | op : '+'|'-' ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST27.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST27;
3 | options {language=JavaScript;output=AST;}
4 | a : op INT -> ^(INT op);
5 | op : '+'|'-' ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST28.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST28;
3 | options {language=JavaScript;output=AST;}
4 | a : 'var' (ID ':' type ';')+ -> ^('var' ^(':' ID type)+) ;
5 | type : 'int' | 'float' ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST29.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST29;
3 | options {language=JavaScript;output=AST;}
4 | tokens {VAR;}
5 | a : ID (',' ID)*-> ^(VAR ID)+ ;
6 | type : 'int' | 'float' ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST3.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST3;
3 | options {language=JavaScript;output=AST;}
4 | a : ID -> ID["x"];
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST30.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST30;
3 | options {language=JavaScript;output=AST;}
4 | tokens {VAR;}
5 | a : b -> ID ;
6 | b : ID ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST31.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST31;
3 | options {language=JavaScript;output=AST;}
4 | tokens {VAR;}
5 | a : ID (',' ID)*-> ^(VAR["var"] ID)+ ;
6 | type : 'int' | 'float' ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST32.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST32;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : lc='{' ID+ '}' -> ^(BLOCK[$lc] ID+) ;
6 | type : 'int' | 'float' ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST33.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST33;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : lc='{' ID+ '}' -> ^(BLOCK[$lc,"block"] ID+) ;
6 | type : 'int' | 'float' ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST34.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST34;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : b b^ ; // 2nd b matches only an INT; can make it root
6 | b : ID INT -> INT ID
7 | | INT
8 | ;
9 | ID : 'a'..'z'+ ;
10 | INT : '0'..'9'+;
11 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST35.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST35;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : b b ;
6 | b : (ID INT -> INT ID | INT INT -> INT+ )
7 | ;
8 | ID : 'a'..'z'+ ;
9 | INT : '0'..'9'+;
10 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST36.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST36;
3 | options {language=JavaScript;output=AST;}
4 | tokens {TYPE;}
5 | a : b b ;
6 | b : 'int'
7 | ( ID -> ^(TYPE 'int' ID)
8 | | ID '=' INT -> ^(TYPE 'int' ID INT)
9 | )
10 | ';'
11 | ;
12 | ID : 'a'..'z'+ ;
13 | INT : '0'..'9'+;
14 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST37.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST37;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : b b ;
6 | b : ID ( ID (last=ID -> $last)+ ) ';' // get last ID
7 | | INT // should still get auto AST construction
8 | ;
9 | ID : 'a'..'z'+ ;
10 | INT : '0'..'9'+;
11 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST38.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST38;
3 | options {language=JavaScript;output=AST;}
4 | a : atom -> ^({this.adaptor.create(INT,"9")} atom) ;
5 | atom : INT ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST39.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST39;
3 | options {language=JavaScript;output=AST;}
4 | a : atom -> {this.adaptor.create(INT,"9")} atom ;
5 | atom : INT ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST4.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST4;
3 | options {language=JavaScript;output=AST;}
4 | a : ID -> ^(ID["x"] INT);
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST40.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST40;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : (atom -> atom) (op='+' r=atom -> ^($op $a $r) )* ;
6 | atom : INT ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST41.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST41;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : atom -> ^(atom atom) ; // NOT CYCLE! (dup atom)
6 | atom : INT ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST42.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST42;
3 | options {language=JavaScript;output=AST;}
4 | a : type ID (',' ID)* ';' -> ^(type ID)+ ;
5 | type : 'int' ;
6 | ID : 'a'..'z'+ ;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST43.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST43;
3 | options {language=JavaScript;output=AST;}
4 | a : modifier? type ID (',' ID)* ';' -> ^(type modifier? ID)+ ;
5 | type : 'int' ;
6 | modifier : 'public' ;
7 | ID : 'a'..'z'+ ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST44.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST44;
3 | options {language=JavaScript;output=AST;}
4 | a : modifier? type ID (',' ID)* ';' -> ^(type modifier? ID)+ ^(type modifier? ID)+ ;
5 | type : 'int' ;
6 | modifier : 'public' ;
7 | ID : 'a'..'z'+ ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST45.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST45;
3 | options {language=JavaScript;output=AST;}
4 | tokens {MOD;}
5 | a : modifier? type ID (',' ID)* ';' -> ^(type ^(MOD modifier)? ID)+ ;
6 | type : 'int' ;
7 | modifier : 'public' ;
8 | ID : 'a'..'z'+ ;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST46.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST46;
3 | options {language=JavaScript;output=AST;}
4 | tokens {MOD;}
5 | a : ID (',' ID)* ';' -> ID+ ID+ ;
6 | ID : 'a'..'z'+ ;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST47.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST47;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : x=b -> $x $x;
6 | b : ID ;
7 | ID : 'a'..'z'+ ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST48.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST48;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : x=b -> ^($x $x);
6 | b : ID ;
7 | ID : 'a'..'z'+ ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST49.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST49;
3 | options {language=JavaScript;output=AST;}
4 | a : 'int' ID (',' ID)* ';' -> ^('int' ID+) ;
5 | op : '+'|'-' ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST5.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST5;
3 | options {language=JavaScript;output=AST;}
4 | a : ID -> ID[ ];
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST50.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST50;
3 | options {language=JavaScript;output=AST;}
4 | a : 'int' ID ';' -> 'int' ID 'int' ID ;
5 | op : '+'|'-' ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST51.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST51;
3 | options {language=JavaScript;output=AST;}
4 | a : 'int' ID (',' ID)* ';' -> ^('int' ID)+ ;
5 | op : '+'|'-' ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST52.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST52;
3 | options {language=JavaScript;output=AST;}
4 | a : 'int' ID ':' INT (',' ID ':' INT)* ';' -> ^('int' ID INT)+ ;
5 | op : '+'|'-' ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST53.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST53;
3 | options {language=JavaScript;output=AST;}
4 | a : ID+ -> ID ID ID ; // works if 3 input IDs
5 | op : '+'|'-' ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST54.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST54;
3 | options {language=JavaScript;output=AST;}
4 | tokens {VAR;}
5 | a : first=ID others+=ID* -> $first VAR $others+ ;
6 | op : '+'|'-' ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST55.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST55;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : A A b=B B b=B c+=C C c+=C D {s=$D.text} -> A+ B+ C+ D ;
6 | type : 'int' | 'float' ;
7 | A : 'a' ;
8 | B : 'b' ;
9 | C : 'c' ;
10 | D : 'd' ;
11 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST56.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST56;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : x=b -> $x;
6 | b : ID ;
7 | ID : 'a'..'z'+ ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST57.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST57;
3 | options {language=JavaScript;output=AST;}
4 | a : ID a -> a | INT ;
5 | ID : 'a'..'z'+ ;
6 | INT: '0'..'9'+ ;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST58.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST58;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : x+=b x+=b -> $x+;
6 | b : ID ;
7 | ID : 'a'..'z'+ ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST59.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST59;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : x+=b x+=b -> $x $x*;
6 | b : ID ;
7 | ID : 'a'..'z'+ ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST6.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST6;
3 | options {language=JavaScript;output=AST;}
4 | a : 'c' -> 'c';
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST60.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST60;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : x=b (y=b)? -> $x $y?;
6 | b : ID ;
7 | ID : 'a'..'z'+ ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST61.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST61;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : x=ID (y=b)? -> $x $y?;
6 | b : ID ;
7 | ID : 'a'..'z'+ ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST62.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST62;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : x=ID (y=b)? -> ($x $y)?;
6 | b : ID ;
7 | ID : 'a'..'z'+ ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST63.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST63;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : x+=ID (y=b)? -> ($x $y)?;
6 | b : ID ;
7 | ID : 'a'..'z'+ ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST64.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST64;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : ID -> ID? ; // match an ID to optional ID
6 | b : ID ;
7 | ID : 'a'..'z'+ ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST65.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST65;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : x+=b x+=b -> {new org.antlr.runtime.tree.CommonTree(null)};
6 | b : ID ;
7 | ID : 'a'..'z'+ ;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST66.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST66;
3 | options {language=JavaScript;output=AST;}
4 | a: (INT|ID)+ -> INT+ ID+ ;
5 | INT: '0'..'9'+;
6 | ID : 'a'..'z'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST67.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST67;
3 | options {language=JavaScript;output=AST;}
4 | a: (INT|ID) -> INT? ID? ;
5 | INT: '0'..'9'+;
6 | ID : 'a'..'z'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST68.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST68;
3 | options {language=JavaScript;output=AST;}
4 | a : x=(INT|ID) -> $x ;
5 | INT: '0'..'9'+;
6 | ID : 'a'..'z'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST69.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST69;
3 | options {language=JavaScript;output=AST;}
4 | tokens { FLOAT; }
5 | r
6 | : INT -> {new org.antlr.runtime.tree.CommonTree(new org.antlr.runtime.CommonToken(FLOAT, $INT.text+".0"))}
7 | ;
8 | INT : '0'..'9'+;
9 | WS: (' ' | '\n' | '\t')+ {$channel = HIDDEN;};
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST7.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST7;
3 | options {language=JavaScript;output=AST;}
4 | a : 'ick' -> 'ick';
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST70.g:
--------------------------------------------------------------------------------
1 | grammar t058rewriteAST70;
2 | options {language=JavaScript;output=AST;}
3 | tokens {PARMS;}
4 | modulo
5 | : 'modulo' ID ('(' parms+ ')')? -> ^('modulo' ID ^(PARMS parms+)?)
6 | ;
7 | parms : '#'|ID;
8 | ID : ('a'..'z' | 'A'..'Z')+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST71.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST71;
3 | options {language=JavaScript;output=AST;}
4 | tokens {BLOCK;}
5 | a : ID ID INT INT INT -> (ID INT)+;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST72.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST72;
3 | options {language=JavaScript;output=AST;}
4 | a : ID+ -> ID ID ID ; // only 2 input IDs
5 | op : '+'|'-' ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST73.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST73;
3 | options {language=JavaScript;output=AST;}
4 | a : ID? INT -> ID INT ;
5 | op : '+'|'-' ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST74.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST74;
3 | options {language=JavaScript;output=AST;}
4 | a : ID? INT -> ID+ INT ;
5 | op : '+'|'-' ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST75.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST75;
3 | options {language=JavaScript;output=AST;}
4 | a : ID c=. -> $c;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST76.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST76;
3 | options {language=JavaScript;output=AST;}
4 | tokens {EXPR;}
5 | decl : type ID '=' INT ';' -> ^(EXPR type ID INT) ;
6 | type : 'int' | 'float' ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST77.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST77;
3 | options {language=JavaScript;output=AST;}
4 | tokens {EXPR;}
5 | decl : type ID '=' INT ';' -> ^(EXPR type ID INT) ;
6 | type : 'int' | 'float' ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST78.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST78;
3 | options {language=JavaScript;output=AST;}
4 | tokens {EXPR;}
5 | decl : type ID '=' INT ';' -> ^(EXPR type ID INT) ;
6 | type : 'int' | 'float' ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST79.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST79;
3 | options {language=JavaScript;output=AST;}
4 | a : ID INT -> ID INT ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST8.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST8;
3 | options {language=JavaScript;output=AST;}
4 | a : b -> b;
5 | b : ID ;
6 | ID : 'a'..'z'+ ;
7 | INT : '0'..'9'+;
8 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST80.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST80;
3 | options {language=JavaScript;output=AST;}
4 | a : b c -> b c;
5 | b : ID -> ID ;
6 | c : INT -> INT ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST81.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST81;
3 | options {language=JavaScript;output=AST;}
4 | a : ID INT -> ID INT ;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST82.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST82;
3 | options {language=JavaScript;output=AST;}
4 | a : b c -> b c;
5 | b : ID -> ID ;
6 | c : INT -> INT ;
7 | ID : 'a'..'z'+ ;
8 | INT : '0'..'9'+;
9 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST83.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST83;
3 | options {language=JavaScript;output=AST;}
4 | a : b -> b | c -> c;
5 | b : ID -> ID ;
6 | c : INT -> INT ;
7 | ID : 'a'..'z'+ ;
8 | S : '*' ;
9 | INT : '0'..'9'+;
10 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/JavaScript/tests/functional/t058rewriteAST9.g:
--------------------------------------------------------------------------------
1 |
2 | grammar t058rewriteAST9;
3 | options {language=JavaScript;output=AST;}
4 | a : ID INT -> INT ID;
5 | ID : 'a'..'z'+ ;
6 | INT : '0'..'9'+;
7 | WS : (' '|'\n') {$channel=HIDDEN;} ;
--------------------------------------------------------------------------------
/runtime/ObjC/ANTLR.framework.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/ObjC/ANTLR.framework.zip
--------------------------------------------------------------------------------
/runtime/ObjC/ANTLR.framework/ANTLR:
--------------------------------------------------------------------------------
1 | Versions/Current/ANTLR
--------------------------------------------------------------------------------
/runtime/ObjC/ANTLR.framework/Headers:
--------------------------------------------------------------------------------
1 | Versions/Current/Headers
--------------------------------------------------------------------------------
/runtime/ObjC/ANTLR.framework/Resources:
--------------------------------------------------------------------------------
1 | Versions/Current/Resources
--------------------------------------------------------------------------------
/runtime/ObjC/ANTLR.framework/Versions/Current:
--------------------------------------------------------------------------------
1 | A
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/ANTLR/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/ObjC/Framework/ANTLR/.DS_Store
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/ANTLR/ANTLR.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/ANTLR/ANTLR/ANTLR-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'ANTLR' target in the 'ANTLR' project
3 | //
4 |
5 | #ifdef __OBJC__
6 | #import
7 | #endif
8 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/ANTLR/ANTLR/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/ANTLR/ANTLRTests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/CHANGES.txt:
--------------------------------------------------------------------------------
1 | ANTLRv3 Objective C Framework
2 |
3 | Kay Roepke
4 |
5 | CHANGES
6 |
7 | December 16, 2007
8 |
9 | * Text of imaginary nodes in tree rewrite mode weren't using NSStrings causing a runtime exception
10 |
11 | * Add currently empty ANTLRCommonTreeNodeStream class, which will be buffering tree nodes
12 |
13 | * Add ANTLRUnbufferedCommonTreeNodeStreamState.h to ANTLR.h umbrella include file
14 |
15 | * Meta change: there now is a CHANGES.txt
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/English.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/ObjC/Framework/English.lproj/InfoPlist.strings
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/LL-star/SimpleC.tokens:
--------------------------------------------------------------------------------
1 | T__7=7
2 | T__8=8
3 | T__9=9
4 | T__10=10
5 | T__11=11
6 | T__12=12
7 | T__13=13
8 | T__14=14
9 | T__15=15
10 | T__16=16
11 | T__17=17
12 | T__18=18
13 | T__19=19
14 | T__20=20
15 | ID=4
16 | INT=5
17 | WS=6
18 | '('=7
19 | ')'=8
20 | '+'=9
21 | ','=10
22 | ';'=11
23 | '<'=12
24 | '='=13
25 | '=='=14
26 | 'char'=15
27 | 'for'=16
28 | 'int'=17
29 | 'void'=18
30 | '{'=19
31 | '}'=20
32 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/LL-star/input:
--------------------------------------------------------------------------------
1 | char c;
2 | int x;
3 |
4 | void bar(int x);
5 |
6 | int foo(int y, char d) {
7 | int i;
8 | for (i=0; i<3; i=i+1) {
9 | x=3;
10 | y=5;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/LL-star/output:
--------------------------------------------------------------------------------
1 | bar is a declaration
2 | foo is a definition
3 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/combined/Combined.g:
--------------------------------------------------------------------------------
1 | grammar Combined;
2 |
3 | options {
4 | language=ObjC;
5 | }
6 |
7 | stat: identifier+ ;
8 |
9 | identifier
10 | : ID
11 | ;
12 |
13 |
14 | ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*
15 | ;
16 |
17 | INT : ('0'..'9')+
18 | ;
19 |
20 | WS : ( ' '
21 | | '\t'
22 | | '\r'
23 | | '\n'
24 | )+
25 | { $channel=99; }
26 | ;
27 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/combined/Combined.tokens:
--------------------------------------------------------------------------------
1 | ID=4
2 | INT=5
3 | WS=6
4 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/combined/Combined__.gl:
--------------------------------------------------------------------------------
1 | lexer grammar Combined;
2 | options {
3 | language=ObjC;
4 |
5 | }
6 |
7 | // $ANTLR src "Combined.g" 14
8 | ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*
9 | ;
10 |
11 | // $ANTLR src "Combined.g" 17
12 | INT : ('0'..'9')+
13 | ;
14 |
15 | // $ANTLR src "Combined.g" 20
16 | WS : ( ' '
17 | | '\t'
18 | | '\r'
19 | | '\n'
20 | )+
21 | { $channel=99; }
22 | ;
23 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/fuzzy/Fuzzy.tokens:
--------------------------------------------------------------------------------
1 | ARG=4
2 | CALL=5
3 | CHAR=6
4 | CLASS=7
5 | COMMENT=8
6 | ESC=9
7 | FIELD=10
8 | ID=11
9 | IMPORT=12
10 | METHOD=13
11 | QID=14
12 | QIDStar=15
13 | RETURN=16
14 | SL_COMMENT=17
15 | STAT=18
16 | STRING=19
17 | TYPE=20
18 | WS=21
19 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/fuzzy/input:
--------------------------------------------------------------------------------
1 | import org.antlr.runtime.*;
2 |
3 | public class Main {
4 | public static void main(String[] args) throws Exception {
5 | for (int i=0; i template(a={$a.st} b:b={$b.st}) "+"
10 | | ^(MULT a=poly b=poly) -> template(a={$a.st} b:b={$b.st}) ""
11 | | ^('^' a=poly b=poly) -> template(a={$a.st} b:b={$b.st}) "^"
12 | | INT -> {%{$INT.text}}
13 | | ID -> {%{$ID.text}}
14 | ;
15 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/polydiff/PolyPrinter.tokens:
--------------------------------------------------------------------------------
1 | T__8=8
2 | T__9=9
3 | MULT=4
4 | INT=5
5 | ID=6
6 | WS=7
7 | '+'=8
8 | '^'=9
9 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/polydiff/Simplifier.tokens:
--------------------------------------------------------------------------------
1 | T__8=8
2 | T__9=9
3 | ID=4
4 | INT=5
5 | MULT=6
6 | WS=7
7 | '+'=8
8 | '^'=9
9 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/polydiff/files:
--------------------------------------------------------------------------------
1 | Poly.g
2 | PolyDifferentiator.g
3 | Simplifier.g
4 | PolyPrinter.g
5 | Main.java
6 | input
7 | output
8 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/polydiff/input:
--------------------------------------------------------------------------------
1 | 2x^3 + x^5 + 4x + 10x + 8x + x + 2
2 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/polydiff/output:
--------------------------------------------------------------------------------
1 | tree=(+ (+ (+ (+ (+ (+ (* 2 (^ x 3)) (^ x 5)) (* 4 x)) (* 10 x)) (* 8 x)) x) 2)
2 | d/dx=(+ (+ (+ (+ (+ (+ (* 6 (^ x 2)) (* 5 (^ x 4))) 4) 10) 8) 1) 0)
3 | simplified=(+ (+ (+ (+ (* 6 (^ x 2)) (* 5 (^ x 4))) 4) 18) 1)
4 | 6x^2+5x^4+4+18+1
5 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/scopes/SymbolTable.tokens:
--------------------------------------------------------------------------------
1 | T__7=7
2 | T__8=8
3 | T__9=9
4 | T__10=10
5 | T__11=11
6 | T__12=12
7 | T__13=13
8 | T__14=14
9 | ID=4
10 | INT=5
11 | WS=6
12 | '('=7
13 | ')'=8
14 | ';'=9
15 | '='=10
16 | 'int'=11
17 | 'method'=12
18 | '{'=13
19 | '}'=14
20 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/scopes/input:
--------------------------------------------------------------------------------
1 | int i;
2 | int j;
3 | method foo() {
4 | int i;
5 | int k;
6 | i=3;
7 | {
8 | int j;
9 | int k;
10 | k = 4;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/scopes/output:
--------------------------------------------------------------------------------
1 | globals: [[@2,4:4='i',<4>,1:4], [@7,11:11='j',<4>,2:4]]
2 | level 2 symbols: [[@37,66:66='j',<4>,8:8], [@42,77:77='k',<4>,9:8]]
3 | level 1 symbols: [[@20,35:35='i',<4>,4:6], [@25,44:44='k',<4>,5:6]]
4 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/simplecTreeParser/SimpleC.tokens:
--------------------------------------------------------------------------------
1 | ARG_DEF=4
2 | BLOCK=5
3 | FUNC_DECL=6
4 | FUNC_DEF=7
5 | FUNC_HDR=8
6 | K_CHAR=9
7 | K_COMMA=10
8 | K_EQ=11
9 | K_EQEQ=12
10 | K_FOR=13
11 | K_ID=14
12 | K_INT=15
13 | K_INT_TYPE=16
14 | K_LCURLY=17
15 | K_LCURVE=18
16 | K_LT=19
17 | K_PLUS=20
18 | K_RCURLY=21
19 | K_RCURVE=22
20 | K_SEMICOLON=23
21 | K_VOID=24
22 | VAR_DEF=25
23 | WS=26
24 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/simplecTreeParser/SimpleCTP.tokens:
--------------------------------------------------------------------------------
1 | ARG_DEF=4
2 | BLOCK=5
3 | FUNC_DECL=6
4 | FUNC_DEF=7
5 | FUNC_HDR=8
6 | K_CHAR=9
7 | K_COMMA=10
8 | K_EQ=11
9 | K_EQEQ=12
10 | K_FOR=13
11 | K_ID=14
12 | K_INT=15
13 | K_INT_TYPE=16
14 | K_LCURLY=17
15 | K_LCURVE=18
16 | K_LT=19
17 | K_PLUS=20
18 | K_RCURLY=21
19 | K_RCURVE=22
20 | K_SEMICOLON=23
21 | K_VOID=24
22 | VAR_DEF=25
23 | WS=26
24 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/simplecTreeParser/SimpleCWalker.tokens:
--------------------------------------------------------------------------------
1 | ARG_DEF=4
2 | BLOCK=5
3 | FUNC_DECL=6
4 | FUNC_DEF=7
5 | FUNC_HDR=8
6 | K_CHAR=9
7 | K_COMMA=10
8 | K_EQ=11
9 | K_EQEQ=12
10 | K_FOR=13
11 | K_ID=14
12 | K_INT=15
13 | K_INT_TYPE=16
14 | K_LCURLY=17
15 | K_LCURVE=18
16 | K_LT=19
17 | K_PLUS=20
18 | K_RCURLY=21
19 | K_RCURVE=22
20 | K_SEMICOLON=23
21 | K_VOID=24
22 | VAR_DEF=25
23 | WS=26
24 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/simplecTreeParser/input:
--------------------------------------------------------------------------------
1 | char c;
2 | int x;
3 |
4 | void bar(int x);
5 |
6 | int foo(int y, char d) {
7 | int i;
8 | for (i=0; i<3; i=i+1) {
9 | x=3;
10 | y=5;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/simplecTreeParser/output:
--------------------------------------------------------------------------------
1 | tree=(VAR_DEF char c) (VAR_DEF int x) (FUNC_DECL (FUNC_HDR void bar (ARG_DEF int x))) (FUNC_DEF (FUNC_HDR int foo (ARG_DEF int y) (ARG_DEF char d)) (BLOCK (VAR_DEF int i) (for (= i 0) (< i 3) (= i (+ i 1)) (BLOCK (= x 3) (= y 5)))))
2 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/treeparser/Lang.tokens:
--------------------------------------------------------------------------------
1 | T__10=10
2 | DECL=4
3 | FLOATTYPE=5
4 | ID=6
5 | INT=7
6 | INTTYPE=8
7 | WS=9
8 | ';'=10
9 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/treeparser/LangDumpDecl.g:
--------------------------------------------------------------------------------
1 | tree grammar LangDumpDecl;
2 | options {
3 | tokenVocab=Lang;
4 | language = ObjC;
5 | ASTLabelType = CommonTree;
6 | }
7 |
8 | decl : ^(DECL type declarator)
9 | // label.start, label.start, label.text
10 | { NSLog(@"int \%@", $declarator.text);}
11 | ;
12 |
13 | type : INTTYPE ;
14 |
15 | declarator
16 | : ID
17 | ;
18 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/treeparser/LangDumpDecl.tokens:
--------------------------------------------------------------------------------
1 | T__10=10
2 | DECL=4
3 | FLOATTYPE=5
4 | ID=6
5 | INT=7
6 | INTTYPE=8
7 | WS=9
8 | ';'=10
9 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/treeparser/README.txt:
--------------------------------------------------------------------------------
1 | Hi. This is a simple demo of tree construction and tree parsing with ANTLR
2 | v3. Here's how to try it out.
3 |
4 | $ java org.antlr.Tool LangParser.g LangTreeParser.g
5 | $ javac *.java
6 | $ java Main input
7 |
8 | You should see out:
9 |
10 | tree: (DECL int a)
11 | int a
12 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/treeparser/files:
--------------------------------------------------------------------------------
1 | README.txt
2 | Main.java
3 | Lang.g
4 | LangDumpDecl.g
5 | input
6 | output
7 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/treeparser/input:
--------------------------------------------------------------------------------
1 | int a;
2 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/treeparser/output:
--------------------------------------------------------------------------------
1 | tree: (DECL int a)
2 | int a
3 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/treerewrite/TreeRewrite.g:
--------------------------------------------------------------------------------
1 | grammar TreeRewrite;
2 |
3 | options {
4 | output=AST;
5 | language=ObjC;
6 | }
7 |
8 | rule: INT subrule -> ^(subrule INT)
9 | ;
10 |
11 | subrule
12 | : INT
13 | ;
14 |
15 | INT : ('0'..'9')+
16 | ;
17 |
18 | WS : ' ' {$channel=HIDDEN;}
19 | ;
20 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/examples/treerewrite/TreeRewrite.tokens:
--------------------------------------------------------------------------------
1 | INT=4
2 | WS=5
3 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/test/runtime/misc/IntArrayTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // IntArrayTest.h
3 | // ANTLR
4 | //
5 | // Created by Ian Michell on 13/05/2010.
6 | // Copyright 2010 Ian Michell. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | @interface IntArrayTest : SenTestCase
13 | {
14 |
15 | }
16 |
17 | -(void) testAdd;
18 | -(void) testPushPop;
19 | -(void) testClearAndAdd;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/test/runtime/recognizer/RecognizerTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // ANTLRRecognizerTest.h
3 | // ANTLR
4 | //
5 | // Created by Ian Michell on 02/07/2010.
6 | // Copyright 2010 Ian Michell. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | @interface ANTLRRecognizerTest : SenTestCase {
13 |
14 | }
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/test/runtime/recognizer/RecognizerTest.m:
--------------------------------------------------------------------------------
1 | //
2 | // RecognizerTest.m
3 | // ANTLR
4 | //
5 | // Created by Ian Michell on 02/07/2010.
6 | // Copyright 2010 Ian Michell. All rights reserved.
7 | //
8 |
9 | #import "RecognizerTest.h"
10 |
11 |
12 | @implementation ANTLRRecognizerTest
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/test/runtime/tree/CommonErrorNodeTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // ANTLRCommonErrorNodeTest.h
3 | // ANTLR
4 | //
5 | // Created by Ian Michell on 10/06/2010.
6 | // Copyright 2010 Ian Michell. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | @interface ANTLRCommonErrorNodeTest : SenTestCase {
13 |
14 | }
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/test/runtime/tree/CommonErrorNodeTest.m:
--------------------------------------------------------------------------------
1 | //
2 | // ANTLRCommonErrorNodeTest.m
3 | // ANTLR
4 | //
5 | // Created by Ian Michell on 10/06/2010.
6 | // Copyright 2010 Ian Michell. All rights reserved.
7 | //
8 |
9 | #import "CommonErrorNodeTest.h"
10 |
11 |
12 | @implementation ANTLRCommonErrorNodeTest
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/test/runtime/tree/CommonTreeAdaptorTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // CommonTreeAdaptorTest.h
3 | // ANTLR
4 | //
5 | // Created by Ian Michell on 10/06/2010.
6 | // Copyright 2010 Ian Michell. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | @interface CommonTreeAdaptorTest : SenTestCase {
13 |
14 | }
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/runtime/ObjC/Framework/test/runtime/tree/CommonTreeAdaptorTest.m:
--------------------------------------------------------------------------------
1 | //
2 | // CommonTreeAdaptorTest.m
3 | // ANTLR
4 | //
5 | // Created by Ian Michell on 10/06/2010.
6 | // Copyright 2010 Ian Michell. All rights reserved.
7 | //
8 |
9 | #import "CommonTreeAdaptorTest.h"
10 |
11 |
12 | @implementation CommonTreeAdaptorTest
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/runtime/Perl5/.p4ignore:
--------------------------------------------------------------------------------
1 | Build
2 | Build.bat
3 | Makefile
4 | Makefile.old
5 | _build
6 | blib
7 | pm_to_blib
8 | tags
9 |
--------------------------------------------------------------------------------
/runtime/Perl5/Changes:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/Perl5/Changes
--------------------------------------------------------------------------------
/runtime/Perl5/INSTALL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/Perl5/INSTALL
--------------------------------------------------------------------------------
/runtime/Perl5/MANIFEST.SKIP:
--------------------------------------------------------------------------------
1 | # project files
2 | \.kpf$
3 |
4 | ^Makefile$
5 | ^pm_to_blib$
6 | ^blib/
7 |
8 | # temporary and backup files
9 | ~$
10 | \.bak$
11 |
--------------------------------------------------------------------------------
/runtime/Perl5/examples/README:
--------------------------------------------------------------------------------
1 | This directory contains examples for the Perl 5 code generation target.
2 |
3 | First you need to compile ANTLR, running "ant" in the top level directory.
4 |
5 | Then you need to build the Perl module.
6 |
7 | perl Makefile.PL
8 | make
9 |
10 | After that you need to compile the grammar using ANTLR, for example by using
11 | the antlr.bat I've added.
12 |
13 | cd examples\expr
14 | ..\..\antlr Expr.g
15 |
16 | Finally you can run the example programs.
17 |
--------------------------------------------------------------------------------
/runtime/Perl5/examples/id/IDLexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar IDLexer;
2 | options { language = Perl5; }
3 |
4 | ID : ('a'..'z'|'A'..'Z')+ ;
5 | INT : '0'..'9'+ ;
6 | NEWLINE:'\r'? '\n' { $self->skip(); } ;
7 | WS : (' '|'\t')+ { $channel = HIDDEN; } ;
8 |
--------------------------------------------------------------------------------
/runtime/Perl5/examples/tweak/input:
--------------------------------------------------------------------------------
1 | method foo() {
2 | i = 3;
3 | k = i;
4 | i = k*4;
5 | }
6 |
7 | method bar() {
8 | j = i*2;
9 | }
10 |
--------------------------------------------------------------------------------
/runtime/Perl5/examples/tweak/output:
--------------------------------------------------------------------------------
1 | public class Wrapper {
2 | public void foo() {
3 | int k;
4 | int i;
5 | i = 3;
6 | k = i;
7 | i = k*4;
8 | }
9 |
10 | public void bar() {
11 | int j;
12 | j = i*2;
13 | }
14 | }
15 |
16 |
17 |
--------------------------------------------------------------------------------
/runtime/Perl5/examples/zero-one/T.g:
--------------------------------------------------------------------------------
1 | lexer grammar T;
2 | options { language = Perl5; }
3 | ZERO: '0';
4 | ONE: '1';
5 |
--------------------------------------------------------------------------------
/runtime/Perl5/lib/ANTLR/Runtime/CharStream.pm:
--------------------------------------------------------------------------------
1 | package ANTLR::Runtime::CharStream;
2 |
3 | use Carp;
4 | use Readonly;
5 |
6 | use Moose::Role;
7 | #extends 'ANTLR::Runtime::IntStream';
8 |
9 | Readonly my $EOF => -1;
10 | sub EOF { return $EOF }
11 |
12 | requires 'substring';
13 |
14 | requires 'LT';
15 |
16 | requires 'get_line', 'set_line';
17 |
18 | requires 'get_char_position_in_line', 'set_char_position_in_line';
19 |
20 | no Moose::Role;
21 | 1;
22 |
--------------------------------------------------------------------------------
/runtime/Perl5/lib/ANTLR/Runtime/EarlyExitException.pm:
--------------------------------------------------------------------------------
1 | package ANTLR::Runtime::EarlyExitException;
2 |
3 | use strict;
4 | use warnings;
5 |
6 | use base qw( ANTLR::Runtime::Exception );
7 |
8 | 1;
9 |
--------------------------------------------------------------------------------
/runtime/Perl5/lib/ANTLR/Runtime/IntStream.pm:
--------------------------------------------------------------------------------
1 | package ANTLR::Runtime::IntStream;
2 |
3 | use Moose::Role;
4 |
5 | requires 'consume';
6 |
7 | requires 'LA';
8 |
9 | requires 'mark';
10 |
11 | requires 'index';
12 |
13 | requires 'rewind';
14 |
15 | requires 'release';
16 |
17 | requires 'seek';
18 |
19 | requires 'size';
20 |
21 | requires 'get_source_name';
22 |
23 | no Moose::Role;
24 | 1;
25 | __END__
26 |
--------------------------------------------------------------------------------
/runtime/Perl5/lib/ANTLR/Runtime/MismatchedSetException.pm:
--------------------------------------------------------------------------------
1 | package ANTLR::Runtime::MismatchedSetException;
2 |
3 | use Moose;
4 |
5 | extends 'ANTLR::Runtime::Exception';
6 |
7 | no Moose;
8 | __PACKAGE__->meta->make_immutable();
9 | 1;
10 |
--------------------------------------------------------------------------------
/runtime/Perl5/lib/ANTLR/Runtime/RuleReturnScope.pm:
--------------------------------------------------------------------------------
1 | package ANTLR::Runtime::RuleReturnScope;
2 |
3 | use Moose;
4 |
5 | sub get_start {
6 | return;
7 | }
8 |
9 | sub get_stop {
10 | return;
11 | }
12 |
13 | sub get_tree {
14 | return;
15 | }
16 |
17 | sub get_template {
18 | return;
19 | }
20 |
21 | no Moose;
22 | __PACKAGE__->meta->make_immutable();
23 | 1;
24 |
--------------------------------------------------------------------------------
/runtime/Perl5/lib/ANTLR/Runtime/Stream.pm:
--------------------------------------------------------------------------------
1 | package ANTLR::Runtime::Stream;
2 |
3 | use Moose::Role;
4 |
5 | requires 'consume';
6 |
7 | requires 'LA';
8 |
9 | requires 'mark';
10 |
11 | requires 'index';
12 |
13 | requires 'rewind';
14 |
15 | requires 'release';
16 |
17 | requires 'seek';
18 |
19 | requires 'size';
20 |
21 | no Moose::Role;
22 | 1;
23 | __END__
24 |
--------------------------------------------------------------------------------
/runtime/Perl5/lib/ANTLR/Runtime/TokenStream.pm:
--------------------------------------------------------------------------------
1 | package ANTLR::Runtime::TokenStream;
2 |
3 | use Moose::Role;
4 | #extends 'ANTLR::Runtime::IntStream';
5 |
6 | requires 'LT';
7 |
8 | requires 'get';
9 |
10 | requires 'get_token_source';
11 |
12 | requires 'to_string';
13 |
14 | no Moose::Role;
15 | 1;
16 | __END__
17 |
--------------------------------------------------------------------------------
/runtime/Perl5/port.yml:
--------------------------------------------------------------------------------
1 | ---
2 | status:
3 | runtime/Java/src/org/antlr/runtime/BitSet.java:
4 | sha1: 0000000000000000000000000000000000000000
5 |
--------------------------------------------------------------------------------
/runtime/Perl5/t/author/perlcritic.t:
--------------------------------------------------------------------------------
1 | use strict;
2 | use warnings;
3 |
4 | use File::Spec;
5 | use English qw(-no_match_vars);
6 |
7 | use Test::More;
8 |
9 | eval {
10 | require Test::Perl::Critic;
11 | };
12 | if ( $EVAL_ERROR ) {
13 | my $msg = 'Test::Perl::Critic required to criticise code';
14 | plan( skip_all => $msg );
15 | }
16 |
17 | my $rcfile = File::Spec->catfile( 't', 'author', 'perlcriticrc' );
18 | Test::Perl::Critic->import( -profile => $rcfile );
19 | all_critic_ok();
20 |
--------------------------------------------------------------------------------
/runtime/Perl5/t/author/perlcriticrc:
--------------------------------------------------------------------------------
1 | severity = 5
2 |
3 | #[-CodeLayout::RequireTidyCode]
4 |
5 | [-Subroutines::ProhibitExplicitReturnUndef]
6 |
--------------------------------------------------------------------------------
/runtime/Perl5/t/author/pod-coverage.t:
--------------------------------------------------------------------------------
1 | use strict;
2 | use warnings;
3 |
4 | use Test::More;
5 |
6 | eval "use Test::Pod::Coverage";
7 | if ($@) {
8 | plan skip_all => "Test::Pod::Coverage required for testing POD coverage: $@";
9 | }
10 | all_pod_coverage_ok();
11 |
--------------------------------------------------------------------------------
/runtime/Perl5/t/author/pod.t:
--------------------------------------------------------------------------------
1 | use strict;
2 | use warnings;
3 |
4 | use Test::More;
5 |
6 | eval "use Test::Pod";
7 | if ($@) {
8 | plan skip_all => "Test::Pod required for testing POD: $@";
9 | }
10 | all_pod_files_ok();
11 |
--------------------------------------------------------------------------------
/runtime/Perl5/t/classes.t:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | use strict;
4 | use warnings;
5 |
6 | use lib 't/lib';
7 | use My::Test::Class::Load 't/classes';
8 |
9 | Test::Class->runtests();
10 |
--------------------------------------------------------------------------------
/runtime/Perl5/t/version.t:
--------------------------------------------------------------------------------
1 | use strict;
2 | use warnings;
3 |
4 | use ExtUtils::MakeMaker;
5 | use Test::More tests => 1;
6 |
7 | my $file = 'lib/ANTLR/Runtime.pm';
8 |
9 | my $version = MM->parse_version($file);
10 |
11 | # classic CPAN
12 | #like($version, qr/^\d+\.\d{2,}(_\d{2,})?$/);
13 |
14 | # version.pm
15 | like($version, qr/^\d+\.\d+\.\d+(?:_\d+)?$/);
16 |
--------------------------------------------------------------------------------
/runtime/Perl5/tools/antlr.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | setlocal
4 |
5 | IF "%ANTLR_HOME%" == "" SET ANTLR_HOME=%~d0%~p0..\..\..
6 |
7 | "%JAVA_HOME%\bin\java" ^
8 | -Dfile.encoding=UTF-8 ^
9 | -classpath "%ANTLR_HOME%\tool\target\classes;%ANTLR_HOME%\runtime\Java\target\classes;%ANTLR_HOME%\lib\antlr-3.0.jar;%ANTLR_HOME%\lib\antlr-2.7.7.jar;%ANTLR_HOME%\lib\stringtemplate-3.0.jar" ^
10 | org.antlr.Tool ^
11 | %*
12 |
13 | endlocal
14 |
--------------------------------------------------------------------------------
/runtime/Perl5/tools/antlr.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | ANTLR_HOME=`dirname "$0"`/../../..
4 |
5 | java -Dfile.encoding=windows-1252 \
6 | -classpath "$ANTLR_HOME/build/classes:$ANTLR_HOME/build/rtclasses:$ANTLR_HOME/lib/antlr-3.0.jar:$ANTLR_HOME/lib/antlr-2.7.7.jar:$ANTLR_HOME/lib/stringtemplate-3.0.jar" \
7 | org.antlr.Tool \
8 | $@
9 |
--------------------------------------------------------------------------------
/runtime/Python/AUTHORS:
--------------------------------------------------------------------------------
1 | Benjamin Niemann : Main developer of Python target.
2 | Clinton Roy : AST templates and runtime.
3 |
--------------------------------------------------------------------------------
/runtime/Python/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include LICENSE AUTHORS ez_setup.py
2 |
3 |
--------------------------------------------------------------------------------
/runtime/Python/dist/antlr_python_runtime-3.4-py2.4.egg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/Python/dist/antlr_python_runtime-3.4-py2.4.egg
--------------------------------------------------------------------------------
/runtime/Python/dist/antlr_python_runtime-3.4-py2.6.egg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/Python/dist/antlr_python_runtime-3.4-py2.6.egg
--------------------------------------------------------------------------------
/runtime/Python/dist/antlr_python_runtime-3.4.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/Python/dist/antlr_python_runtime-3.4.tar.gz
--------------------------------------------------------------------------------
/runtime/Python/dist/antlr_python_runtime-3.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/runtime/Python/dist/antlr_python_runtime-3.4.zip
--------------------------------------------------------------------------------
/runtime/Python/tests/t001lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t001lexer;
2 | options {
3 | language = Python;
4 | }
5 |
6 | ZERO: '0';
7 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t002lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t002lexer;
2 | options {
3 | language = Python;
4 | }
5 |
6 | ZERO: '0';
7 | ONE: '1';
8 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t003lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t003lexer;
2 | options {
3 | language = Python;
4 | }
5 |
6 | ZERO: '0';
7 | ONE: '1';
8 | FOOZE: 'fooze';
9 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t004lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t004lexer;
2 | options {
3 | language = Python;
4 | }
5 |
6 | FOO: 'f' 'o'*;
7 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t005lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t005lexer;
2 | options {
3 | language = Python;
4 | }
5 |
6 | FOO: 'f' 'o'+;
7 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t006lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t006lexer;
2 | options {
3 | language = Python;
4 | }
5 |
6 | FOO: 'f' ('o' | 'a')*;
7 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t007lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t007lexer;
2 | options {
3 | language = Python;
4 | }
5 |
6 | FOO: 'f' ('o' | 'a' 'b'+)*;
7 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t008lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t008lexer;
2 | options {
3 | language = Python;
4 | }
5 |
6 | FOO: 'f' 'a'?;
7 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t009lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t009lexer;
2 | options {
3 | language = Python;
4 | }
5 |
6 | DIGIT: '0' .. '9';
7 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t010lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t010lexer;
2 | options {
3 | language = Python;
4 | }
5 |
6 | IDENTIFIER: ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*;
7 | WS: (' ' | '\n')+;
8 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t011lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t011lexer;
2 | options {
3 | language = Python;
4 | }
5 |
6 | IDENTIFIER:
7 | ('a'..'z'|'A'..'Z'|'_')
8 | ('a'..'z'
9 | |'A'..'Z'
10 | |'0'..'9'
11 | |'_'
12 | {
13 | print "Underscore"
14 | print "foo"
15 | }
16 | )*
17 | ;
18 |
19 | WS: (' ' | '\n')+;
20 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t012lexerXML.input:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
10 | ]>
11 |
12 |
13 | Text
14 |
15 | öäüß
16 | &
17 | <
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t018llstar.input:
--------------------------------------------------------------------------------
1 | char c;
2 | int x;
3 |
4 | void bar(int x);
5 |
6 | int foo(int y, char d) {
7 | int i;
8 | for (i=0; i<3; i=i+1) {
9 | x=3;
10 | y=5;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t018llstar.output:
--------------------------------------------------------------------------------
1 | bar is a declaration
2 | foo is a definition
3 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t019lexer.input:
--------------------------------------------------------------------------------
1 | import org.antlr.runtime.*;
2 |
3 | public class Main {
4 | public static void main(String[] args) throws Exception {
5 | for (int i=0; i '';
3 | MDO: {True}? (' ' '<';
5 | CDATA: '<';
6 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t029synpredgate.g:
--------------------------------------------------------------------------------
1 | lexer grammar t029synpredgate;
2 | options {
3 | language = Python;
4 | }
5 |
6 | FOO
7 | : ('ab')=> A
8 | | ('ac')=> B
9 | ;
10 |
11 | fragment
12 | A: 'a';
13 |
14 | fragment
15 | B: 'a';
16 |
17 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t029synpredgate.py:
--------------------------------------------------------------------------------
1 | import antlr3
2 | import testbase
3 | import unittest
4 |
5 |
6 | class t029synpredgate(testbase.ANTLRTest):
7 | def setUp(self):
8 | self.compileGrammar()
9 |
10 |
11 | def testValid1(self):
12 | stream = antlr3.StringStream('ac')
13 | lexer = self.getLexer(stream)
14 | token = lexer.nextToken()
15 |
16 |
17 | if __name__ == '__main__':
18 | unittest.main()
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t031emptyAlt.g:
--------------------------------------------------------------------------------
1 | grammar t031emptyAlt;
2 | options {
3 | language = Python;
4 | }
5 |
6 | r
7 | : NAME
8 | ( {self.cond}?=> WS+ NAME
9 | |
10 | )
11 | EOF
12 | ;
13 |
14 | NAME: ('a'..'z') ('a'..'z' | '0'..'9')+;
15 | NUMBER: ('0'..'9')+;
16 | WS: ' '+;
17 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t032subrulePredict.g:
--------------------------------------------------------------------------------
1 | grammar t032subrulePredict;
2 | options {
3 | language = Python;
4 | }
5 |
6 | a: 'BEGIN' b WS+ 'END';
7 | b: ( WS+ 'A' )+;
8 | WS: ' ';
9 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t035ruleLabelPropertyRef.g:
--------------------------------------------------------------------------------
1 | grammar t035ruleLabelPropertyRef;
2 | options {
3 | language = Python;
4 | }
5 |
6 | a returns [bla]: t=b
7 | {
8 | $bla = $t.start, $t.stop, $t.text
9 | }
10 | ;
11 |
12 | b: A+;
13 |
14 | A: 'a'..'z';
15 |
16 | WS: ' '+ { $channel = HIDDEN };
17 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t036multipleReturnValues.g:
--------------------------------------------------------------------------------
1 | grammar t036multipleReturnValues;
2 | options {
3 | language = Python;
4 | }
5 |
6 | a returns [foo, bar]: A
7 | {
8 | $foo = "foo";
9 | $bar = "bar";
10 | }
11 | ;
12 |
13 | A: 'a'..'z';
14 |
15 | WS :
16 | ( ' '
17 | | '\t'
18 | | ( '\n'
19 | | '\r\n'
20 | | '\r'
21 | )
22 | )+
23 | { $channel = HIDDEN }
24 | ;
25 |
26 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t037rulePropertyRef.g:
--------------------------------------------------------------------------------
1 | grammar t037rulePropertyRef;
2 | options {
3 | language = Python;
4 | }
5 |
6 | a returns [bla]
7 | @after {
8 | $bla = $start, $stop, $text
9 | }
10 | : A+
11 | ;
12 |
13 | A: 'a'..'z';
14 |
15 | WS: ' '+ { $channel = HIDDEN };
16 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t039labels.g:
--------------------------------------------------------------------------------
1 | grammar t039labels;
2 | options {
3 | language = Python;
4 | }
5 |
6 | a returns [l]
7 | : ids+=A ( ',' ids+=(A|B) )* C D w=. ids+=. F EOF
8 | { l = ($ids, $w) }
9 | ;
10 |
11 | A: 'a'..'z';
12 | B: '0'..'9';
13 | C: a='A' { print $a };
14 | D: a='FOOBAR' { print $a };
15 | E: 'GNU' a=. { print $a };
16 | F: 'BLARZ' a=EOF { print $a };
17 |
18 | WS: ' '+ { $channel = HIDDEN };
19 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t040bug80.g:
--------------------------------------------------------------------------------
1 | lexer grammar t040bug80;
2 | options {
3 | language = Python;
4 | }
5 |
6 | ID_LIKE
7 | : 'defined'
8 | | {False}? Identifier
9 | | Identifier
10 | ;
11 |
12 | fragment
13 | Identifier: 'a'..'z'+ ; // with just 'a', output compiles
14 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t041parameters.g:
--------------------------------------------------------------------------------
1 | grammar t041parameters;
2 | options {
3 | language = Python;
4 | }
5 |
6 | a[arg1, arg2] returns [l]
7 | : A+ EOF
8 | {
9 | l = ($arg1, $arg2)
10 | $arg1 = "gnarz"
11 | }
12 | ;
13 |
14 | A: 'a'..'z';
15 |
16 | WS: ' '+ { $channel = HIDDEN };
17 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t043synpred.g:
--------------------------------------------------------------------------------
1 | grammar t043synpred;
2 | options {
3 | language = Python;
4 | }
5 |
6 | a: ((s+ P)=> s+ b)? E;
7 | b: P 'foo';
8 |
9 | s: S;
10 |
11 |
12 | S: ' ';
13 | P: '+';
14 | E: '>';
15 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t044trace.g:
--------------------------------------------------------------------------------
1 | grammar t044trace;
2 | options {
3 | language = Python;
4 | }
5 |
6 | @init {
7 | self._stack = None
8 | }
9 |
10 | a: '<' ((INT '+')=>b|c) '>';
11 | b: c ('+' c)*;
12 | c: INT
13 | {
14 | if self._stack is None:
15 | self._stack = self.getRuleInvocationStack()
16 | }
17 | ;
18 |
19 | INT: ('0'..'9')+;
20 | WS: (' ' | '\n' | '\t')+ {$channel = HIDDEN;};
21 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t048rewrite.g:
--------------------------------------------------------------------------------
1 | lexer grammar t048rewrite;
2 | options {
3 | language=Python;
4 | }
5 |
6 | A: 'a';
7 | B: 'b';
8 | C: 'c';
9 |
10 |
--------------------------------------------------------------------------------
/runtime/Python/tests/t048rewrite2.g:
--------------------------------------------------------------------------------
1 | lexer grammar t048rewrite2;
2 | options {
3 | language=Python;
4 | }
5 |
6 | ID : 'a'..'z'+;
7 | INT : '0'..'9'+;
8 | SEMI : ';';
9 | PLUS : '+';
10 | MUL : '*';
11 | ASSIGN : '=';
12 | WS : ' '+;
13 |
--------------------------------------------------------------------------------
/runtime/Python/unittests/testantlr3.py:
--------------------------------------------------------------------------------
1 |
2 | import unittest
3 |
4 | import antlr3
5 |
6 | if __name__ == "__main__":
7 | unittest.main(testRunner=unittest.TextTestRunner(verbosity=2))
8 |
--------------------------------------------------------------------------------
/runtime/Python/unittests/teststreams.input1:
--------------------------------------------------------------------------------
1 | foo
2 | bar
--------------------------------------------------------------------------------
/runtime/Python/unittests/teststreams.input2:
--------------------------------------------------------------------------------
1 | foo
2 | bär
--------------------------------------------------------------------------------
/runtime/Python3/.gitignore:
--------------------------------------------------------------------------------
1 | .*.swp
2 | *~
3 | *.pyc
4 | *.gz
5 |
--------------------------------------------------------------------------------
/runtime/Python3/AUTHORS:
--------------------------------------------------------------------------------
1 | Python target:
2 | Benjamin Niemann : Main developer of Python target.
3 | Clinton Roy : AST templates and runtime.
4 |
5 | Python3 target:
6 | Benjamin S Wolf (http://github.com/Zannick): Converted Python target to Python3.
7 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t001lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t001lexer;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | ZERO: '0';
7 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t002lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t002lexer;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | ZERO: '0';
7 | ONE: '1';
8 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t003lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t003lexer;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | ZERO: '0';
7 | ONE: '1';
8 | FOOZE: 'fooze';
9 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t004lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t004lexer;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | FOO: 'f' 'o'*;
7 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t005lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t005lexer;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | FOO: 'f' 'o'+;
7 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t006lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t006lexer;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | FOO: 'f' ('o' | 'a')*;
7 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t007lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t007lexer;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | FOO: 'f' ('o' | 'a' 'b'+)*;
7 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t008lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t008lexer;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | FOO: 'f' 'a'?;
7 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t009lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t009lexer;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | DIGIT: '0' .. '9';
7 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t010lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t010lexer;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | IDENTIFIER: ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*;
7 | WS: (' ' | '\n')+;
8 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t011lexer.g:
--------------------------------------------------------------------------------
1 | lexer grammar t011lexer;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | IDENTIFIER:
7 | ('a'..'z'|'A'..'Z'|'_')
8 | ('a'..'z'
9 | |'A'..'Z'
10 | |'0'..'9'
11 | |'_'
12 | {
13 | print("Underscore")
14 | print("foo")
15 | }
16 | )*
17 | ;
18 |
19 | WS: (' ' | '\n')+;
20 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t012lexerXML.input:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
10 | ]>
11 |
12 |
13 | Text
14 |
15 | öäüß
16 | &
17 | <
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t018llstar.input:
--------------------------------------------------------------------------------
1 | char c;
2 | int x;
3 |
4 | void bar(int x);
5 |
6 | int foo(int y, char d) {
7 | int i;
8 | for (i=0; i<3; i=i+1) {
9 | x=3;
10 | y=5;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t018llstar.output:
--------------------------------------------------------------------------------
1 | bar is a declaration
2 | foo is a definition
3 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t019lexer.input:
--------------------------------------------------------------------------------
1 | import org.antlr.runtime.*;
2 |
3 | public class Main {
4 | public static void main(String[] args) throws Exception {
5 | for (int i=0; i '';
3 | MDO: {True}? (' ' '<';
5 | CDATA: '<';
6 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t029synpredgate.g:
--------------------------------------------------------------------------------
1 | lexer grammar t029synpredgate;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | FOO
7 | : ('ab')=> A
8 | | ('ac')=> B
9 | ;
10 |
11 | fragment
12 | A: 'a';
13 |
14 | fragment
15 | B: 'a';
16 |
17 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t029synpredgate.py:
--------------------------------------------------------------------------------
1 | import antlr3
2 | import testbase
3 | import unittest
4 |
5 |
6 | class t029synpredgate(testbase.ANTLRTest):
7 | def setUp(self):
8 | self.compileGrammar()
9 |
10 |
11 | def testValid1(self):
12 | stream = antlr3.StringStream('ac')
13 | lexer = self.getLexer(stream)
14 | token = lexer.nextToken()
15 |
16 |
17 | if __name__ == '__main__':
18 | unittest.main()
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t031emptyAlt.g:
--------------------------------------------------------------------------------
1 | grammar t031emptyAlt;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | r
7 | : NAME
8 | ( {self.cond}?=> WS+ NAME
9 | |
10 | )
11 | EOF
12 | ;
13 |
14 | NAME: ('a'..'z') ('a'..'z' | '0'..'9')+;
15 | NUMBER: ('0'..'9')+;
16 | WS: ' '+;
17 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t032subrulePredict.g:
--------------------------------------------------------------------------------
1 | grammar t032subrulePredict;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | a: 'BEGIN' b WS+ 'END';
7 | b: ( WS+ 'A' )+;
8 | WS: ' ';
9 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t035ruleLabelPropertyRef.g:
--------------------------------------------------------------------------------
1 | grammar t035ruleLabelPropertyRef;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | a returns [bla]: t=b
7 | {
8 | $bla = $t.start, $t.stop, $t.text
9 | }
10 | ;
11 |
12 | b: A+;
13 |
14 | A: 'a'..'z';
15 |
16 | WS: ' '+ { $channel = HIDDEN };
17 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t036multipleReturnValues.g:
--------------------------------------------------------------------------------
1 | grammar t036multipleReturnValues;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | a returns [foo, bar]: A
7 | {
8 | $foo = "foo";
9 | $bar = "bar";
10 | }
11 | ;
12 |
13 | A: 'a'..'z';
14 |
15 | WS :
16 | ( ' '
17 | | '\t'
18 | | ( '\n'
19 | | '\r\n'
20 | | '\r'
21 | )
22 | )+
23 | { $channel = HIDDEN }
24 | ;
25 |
26 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t037rulePropertyRef.g:
--------------------------------------------------------------------------------
1 | grammar t037rulePropertyRef;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | a returns [bla]
7 | @after {
8 | $bla = $start, $stop, $text
9 | }
10 | : A+
11 | ;
12 |
13 | A: 'a'..'z';
14 |
15 | WS: ' '+ { $channel = HIDDEN };
16 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t039labels.g:
--------------------------------------------------------------------------------
1 | grammar t039labels;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | a returns [l]
7 | : ids+=A ( ',' ids+=(A|B) )* C D w=. ids+=. F EOF
8 | { l = ($ids, $w) }
9 | ;
10 |
11 | A: 'a'..'z';
12 | B: '0'..'9';
13 | C: a='A' { print($a) };
14 | D: a='FOOBAR' { print($a) };
15 | E: 'GNU' a=. { print($a) };
16 | F: 'BLARZ' a=EOF { print($a) };
17 |
18 | WS: ' '+ { $channel = HIDDEN };
19 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t040bug80.g:
--------------------------------------------------------------------------------
1 | lexer grammar t040bug80;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | ID_LIKE
7 | : 'defined'
8 | | {False}? Identifier
9 | | Identifier
10 | ;
11 |
12 | fragment
13 | Identifier: 'a'..'z'+ ; // with just 'a', output compiles
14 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t041parameters.g:
--------------------------------------------------------------------------------
1 | grammar t041parameters;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | a[arg1, arg2] returns [l]
7 | : A+ EOF
8 | {
9 | l = ($arg1, $arg2)
10 | $arg1 = "gnarz"
11 | }
12 | ;
13 |
14 | A: 'a'..'z';
15 |
16 | WS: ' '+ { $channel = HIDDEN };
17 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t043synpred.g:
--------------------------------------------------------------------------------
1 | grammar t043synpred;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | a: ((s+ P)=> s+ b)? E;
7 | b: P 'foo';
8 |
9 | s: S;
10 |
11 |
12 | S: ' ';
13 | P: '+';
14 | E: '>';
15 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t044trace.g:
--------------------------------------------------------------------------------
1 | grammar t044trace;
2 | options {
3 | language = Python3;
4 | }
5 |
6 | @init {
7 | self._stack = None
8 | }
9 |
10 | a: '<' ((INT '+')=>b|c) '>';
11 | b: c ('+' c)*;
12 | c: INT
13 | {
14 | if self._stack is None:
15 | self._stack = self.getRuleInvocationStack()
16 | }
17 | ;
18 |
19 | INT: ('0'..'9')+;
20 | WS: (' ' | '\n' | '\t')+ {$channel = HIDDEN;};
21 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t048rewrite.g:
--------------------------------------------------------------------------------
1 | lexer grammar t048rewrite;
2 | options {
3 | language=Python3;
4 | }
5 |
6 | A: 'a';
7 | B: 'b';
8 | C: 'c';
9 |
10 |
--------------------------------------------------------------------------------
/runtime/Python3/tests/t048rewrite2.g:
--------------------------------------------------------------------------------
1 | lexer grammar t048rewrite2;
2 | options {
3 | language=Python3;
4 | }
5 |
6 | ID : 'a'..'z'+;
7 | INT : '0'..'9'+;
8 | SEMI : ';';
9 | PLUS : '+';
10 | MUL : '*';
11 | ASSIGN : '=';
12 | WS : ' '+;
13 |
--------------------------------------------------------------------------------
/runtime/Python3/unittests/testantlr3.py:
--------------------------------------------------------------------------------
1 |
2 | import unittest
3 |
4 | import antlr3
5 |
6 | if __name__ == "__main__":
7 | unittest.main(testRunner=unittest.TextTestRunner(verbosity=2))
8 |
--------------------------------------------------------------------------------
/runtime/Python3/unittests/teststreams.input1:
--------------------------------------------------------------------------------
1 | foo
2 | bar
--------------------------------------------------------------------------------
/runtime/Python3/unittests/teststreams.input2:
--------------------------------------------------------------------------------
1 | foo
2 | bär
--------------------------------------------------------------------------------
/runtime/Ruby/test/unit/sample-input/file-stream-1:
--------------------------------------------------------------------------------
1 | foo
2 | bar
--------------------------------------------------------------------------------
/runtime/Ruby/test/unit/sample-input/teststreams.input2:
--------------------------------------------------------------------------------
1 | foo
2 | bär
--------------------------------------------------------------------------------
/tool/antlr.config:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/antlr/antlr3/7bd56e65a5662ddef458dacdf2202189521aef41/tool/antlr.config
--------------------------------------------------------------------------------
/tool/src/main/resources/org/antlr/antlr.properties:
--------------------------------------------------------------------------------
1 | # This properties file is used by ANTLR to pick up any resources
2 | # and configuration options that may or may not be produced by
3 | # the build process. For instance the Tool version string is
4 | # filtered into this resource file so that we don't need to
5 | # hard code this into Tool.java and so on.
6 | #
7 | antlr.version=${project.version} ${buildNumber}
8 |
--------------------------------------------------------------------------------
/tool/src/main/resources/org/antlr/tool/templates/depend.stg:
--------------------------------------------------------------------------------
1 | /** templates used to generate make-compatible dependencies */
2 | group depend;
3 |
4 | /** Generate "f : x, y, z" dependencies for input
5 | * dependencies and generated files. in and out
6 | * are File objects. For example, you can say
7 | *
8 | */
9 | dependencies(grammarFileName,in,out) ::= <<
10 | :
11 | : }; separator="\n">
12 | >>
13 |
--------------------------------------------------------------------------------