summaryrefslogtreecommitdiff
path: root/impl/parser
diff options
context:
space:
mode:
Diffstat (limited to 'impl/parser')
-rw-r--r--impl/parser/EquationSystem.tokens33
-rw-r--r--impl/parser/EquationSystemLexer.c2087
-rw-r--r--impl/parser/EquationSystemLexer.h313
-rw-r--r--impl/parser/EquationSystemLexer.obin0 -> 10104 bytes
-rw-r--r--impl/parser/EquationSystemParser.c2460
-rw-r--r--impl/parser/EquationSystemParser.h324
-rw-r--r--impl/parser/EquationSystemParser.obin0 -> 26200 bytes
7 files changed, 5217 insertions, 0 deletions
diff --git a/impl/parser/EquationSystem.tokens b/impl/parser/EquationSystem.tokens
new file mode 100644
index 0000000..c706036
--- /dev/null
+++ b/impl/parser/EquationSystem.tokens
@@ -0,0 +1,33 @@
+T__19=19
+T__20=20
+T__21=21
+T__22=22
+COMMA=4
+DIGIT=5
+GREATER_EQUAL=6
+GUARD=7
+LETTER=8
+MAXIMUM=9
+MINIMUM=10
+MULT=11
+NEWLINE=12
+NUMBER=13
+PLUS=14
+QUESTION_MARK=15
+SUB=16
+VARIABLE=17
+WHITESPACE=18
+'('=19
+')'=20
+'*'=11
+'+'=14
+','=21
+'-'=16
+';'=4
+'='=22
+'>='=6
+'?'=15
+'\n'=12
+'guard'=7
+'max'=9
+'min'=10
diff --git a/impl/parser/EquationSystemLexer.c b/impl/parser/EquationSystemLexer.c
new file mode 100644
index 0000000..dc8b451
--- /dev/null
+++ b/impl/parser/EquationSystemLexer.c
@@ -0,0 +1,2087 @@
+/** \file
+ * This C source file was generated by $ANTLR version 3.4
+ *
+ * - From the grammar source file : EquationSystem.g
+ * - On : 2012-07-12 15:47:53
+ * - for the lexer : EquationSystemLexerLexer
+ *
+ * Editing it, at least manually, is not wise.
+ *
+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
+ *
+ *
+*/
+// [The "BSD license"]
+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
+// http://www.temporal-wave.com
+// http://www.linkedin.com/in/jimidle
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. The name of the author may not be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/* -----------------------------------------
+ * Include the ANTLR3 generated header file.
+ */
+#include "EquationSystemLexer.h"
+/* ----------------------------------------- */
+
+
+/** String literals used by EquationSystemLexer that we must do things like MATCHS() with.
+ * C will normally just lay down 8 bit characters, and you can use L"xxx" to
+ * get wchar_t, but wchar_t is 16 bits on Windows, which is not UTF32 and so
+ * we perform this little trick of defining the literals as arrays of UINT32
+ * and passing in the address of these.
+ */
+static ANTLR3_UCHAR lit_1[] = { 0x3E, 0x3D, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_2[] = { 0x67, 0x75, 0x61, 0x72, 0x64, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_3[] = { 0x6D, 0x61, 0x78, ANTLR3_STRING_TERMINATOR};
+static ANTLR3_UCHAR lit_4[] = { 0x6D, 0x69, 0x6E, ANTLR3_STRING_TERMINATOR};
+
+
+
+
+
+/* MACROS that hide the C interface implementations from the
+ * generated code, which makes it a little more understandable to the human eye.
+ * I am very much against using C pre-processor macros for function calls and bits
+ * of code as you cannot see what is happening when single stepping in debuggers
+ * and so on. The exception (in my book at least) is for generated code, where you are
+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
+ * hides some indirect calls, but is always referring to the input stream. This is
+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
+ * the runtime interfaces without changing the generated code too often, without
+ * confusing the reader of the generated output, who may not wish to know the gory
+ * details of the interface inheritance.
+ */
+
+#define CTX ctx
+
+/* Aids in accessing scopes for grammar programmers
+ */
+#undef SCOPE_TYPE
+#undef SCOPE_STACK
+#undef SCOPE_TOP
+#define SCOPE_TYPE(scope) pEquationSystemLexer_##scope##_SCOPE
+#define SCOPE_STACK(scope) pEquationSystemLexer_##scope##Stack
+#define SCOPE_TOP(scope) ctx->pEquationSystemLexer_##scope##Top
+#define SCOPE_SIZE(scope) ctx->pEquationSystemLexer_##scope##Stack_limit
+#define SCOPE_INSTANCE(scope, i) (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
+
+
+/* Macros for accessing things in a lexer
+ */
+#undef LEXER
+#undef RECOGNIZER
+#undef RULEMEMO
+#undef GETCHARINDEX
+#undef GETLINE
+#undef GETCHARPOSITIONINLINE
+#undef EMIT
+#undef EMITNEW
+#undef MATCHC
+#undef MATCHS
+#undef MATCHRANGE
+#undef LTOKEN
+#undef HASFAILED
+#undef FAILEDFLAG
+#undef INPUT
+#undef STRSTREAM
+#undef LA
+#undef HASEXCEPTION
+#undef EXCEPTION
+#undef CONSTRUCTEX
+#undef CONSUME
+#undef LRECOVER
+#undef MARK
+#undef REWIND
+#undef REWINDLAST
+#undef BACKTRACKING
+#undef MATCHANY
+#undef MEMOIZE
+#undef HAVEPARSEDRULE
+#undef GETTEXT
+#undef INDEX
+#undef SEEK
+#undef PUSHSTREAM
+#undef POPSTREAM
+#undef SETTEXT
+#undef SETTEXT8
+
+#define LEXER ctx->pLexer
+#define RECOGNIZER LEXER->rec
+#define LEXSTATE RECOGNIZER->state
+#define TOKSOURCE LEXSTATE->tokSource
+#define GETCHARINDEX() LEXER->getCharIndex(LEXER)
+#define GETLINE() LEXER->getLine(LEXER)
+#define GETTEXT() LEXER->getText(LEXER)
+#define GETCHARPOSITIONINLINE() LEXER->getCharPositionInLine(LEXER)
+#define EMIT() LEXSTATE->type = _type; LEXER->emit(LEXER)
+#define EMITNEW(t) LEXER->emitNew(LEXER, t)
+#define MATCHC(c) LEXER->matchc(LEXER, c)
+#define MATCHS(s) LEXER->matchs(LEXER, s)
+#define MATCHRANGE(c1,c2) LEXER->matchRange(LEXER, c1, c2)
+#define MATCHANY() LEXER->matchAny(LEXER)
+#define LTOKEN LEXSTATE->token
+#define HASFAILED() (LEXSTATE->failed == ANTLR3_TRUE)
+#define BACKTRACKING LEXSTATE->backtracking
+#define FAILEDFLAG LEXSTATE->failed
+#define INPUT LEXER->input
+#define STRSTREAM INPUT
+#define ISTREAM INPUT->istream
+#define INDEX() ISTREAM->index(ISTREAM)
+#define SEEK(n) ISTREAM->seek(ISTREAM, n)
+#define EOF_TOKEN &(LEXSTATE->tokSource->eofToken)
+#define HASEXCEPTION() (LEXSTATE->error == ANTLR3_TRUE)
+#define EXCEPTION LEXSTATE->exception
+#define CONSTRUCTEX() RECOGNIZER->exConstruct(RECOGNIZER)
+#define LRECOVER() LEXER->recover(LEXER)
+#define MARK() ISTREAM->mark(ISTREAM)
+#define REWIND(m) ISTREAM->rewind(ISTREAM, m)
+#define REWINDLAST() ISTREAM->rewindLast(ISTREAM)
+#define MEMOIZE(ri,si) RECOGNIZER->memoize(RECOGNIZER, ri, si)
+#define HAVEPARSEDRULE(r) RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
+#define PUSHSTREAM(str) LEXER->pushCharStream(LEXER, str)
+#define POPSTREAM() LEXER->popCharStream(LEXER)
+#define SETTEXT(str) LEXSTATE->text = str
+#define SKIP() LEXSTATE->token = &(TOKSOURCE->skipToken)
+#define USER1 LEXSTATE->user1
+#define USER2 LEXSTATE->user2
+#define USER3 LEXSTATE->user3
+#define CUSTOM LEXSTATE->custom
+#define RULEMEMO LEXSTATE->ruleMemo
+#define DBG RECOGNIZER->debugger
+
+/* If we have been told we can rely on the standard 8 bit or UTF16 input
+ * stream, then we can define our macros to use the direct pointers
+ * in the input object, which is much faster than indirect calls. This
+ * is really only significant to lexers with a lot of fragment rules (which
+ * do not place LA(1) in a temporary at the moment) and even then
+ * only if there is a lot of input (order of say 1M or so).
+ */
+#if defined(ANTLR3_INLINE_INPUT_8BIT) || defined(ANTLR3_INLINE_INPUT_UTF16)
+
+# ifdef ANTLR3_INLINE_INPUT_8BIT
+
+/* 8 bit character set */
+
+# define NEXTCHAR ((pANTLR3_UINT8)(INPUT->nextChar))
+# define DATAP ((pANTLR3_UINT8)(INPUT->data))
+
+# else
+
+# define NEXTCHAR ((pANTLR3_UINT16)(INPUT->nextChar))
+# define DATAP ((pANTLR3_UINT16)(INPUT->data))
+
+# endif
+
+# define LA(n) ((NEXTCHAR + n) > (DATAP + INPUT->sizeBuf) ? ANTLR3_CHARSTREAM_EOF : (ANTLR3_UCHAR)(*(NEXTCHAR + n - 1)))
+# define CONSUME() \
+{ \
+ if (NEXTCHAR < (DATAP + INPUT->sizeBuf)) \
+ { \
+ INPUT->charPositionInLine++; \
+ if ((ANTLR3_UCHAR)(*NEXTCHAR) == INPUT->newlineChar) \
+ { \
+ INPUT->line++; \
+ INPUT->charPositionInLine = 0; \
+ INPUT->currentLine = (void *)(NEXTCHAR + 1); \
+ } \
+ INPUT->nextChar = (void *)(NEXTCHAR + 1); \
+ } \
+}
+
+#else
+
+// Pick up the input character by calling the input stream implementation.
+//
+#define CONSUME() INPUT->istream->consume(INPUT->istream)
+#define LA(n) INPUT->istream->_LA(INPUT->istream, n)
+
+#endif
+
+#define TOKTEXT(tok, txt) tok, (pANTLR3_UINT8)txt
+
+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
+ * then for the present you must use different names for your defines as these are hard coded
+ * in the code generator. It would be better not to use such names internally, and maybe
+ * we can change this in a forthcoming release. I deliberately do not #undef these
+ * here as this will at least give you a redefined error somewhere if they clash.
+ */
+#define UP ANTLR3_TOKEN_UP
+#define DOWN ANTLR3_TOKEN_DOWN
+#define EOR ANTLR3_TOKEN_EOR
+#define INVALID ANTLR3_TOKEN_INVALID
+
+
+/* =============================================================================
+ * Functions to create and destroy scopes. First come the rule scopes, followed
+ * by the global declared scopes.
+ */
+
+
+
+/* ============================================================================= */
+
+/* =============================================================================
+ * Start of recognizer
+ */
+
+/* Forward declare the locally static matching functions we have generated and any predicate functions.
+ */
+static ANTLR3_INLINE
+ void
+ mCOMMA (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mGREATER_EQUAL (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mGUARD (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mMAXIMUM (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mMINIMUM (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mMULT (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mNEWLINE (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mPLUS (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mQUESTION_MARK (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mSUB (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__19 (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__20 (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__21 (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mT__22 (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mNUMBER (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mVARIABLE (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mWHITESPACE (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mDIGIT (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mLETTER (pEquationSystemLexer ctx);
+static ANTLR3_INLINE
+ void
+ mTokens (pEquationSystemLexer ctx);
+static void EquationSystemLexerFree(pEquationSystemLexer ctx);
+
+/* =========================================================================
+ * Lexer matching rules end.
+ * =========================================================================
+ */
+
+
+
+static void
+EquationSystemLexerFree (pEquationSystemLexer ctx)
+{
+ LEXER->free(LEXER);
+
+ ANTLR3_FREE(ctx);
+}
+
+static void
+EquationSystemLexerReset (pEquationSystemLexer ctx)
+{
+ RECOGNIZER->reset(RECOGNIZER);
+}
+
+/** \brief Name of the grammar file that generated this code
+ */
+static const char fileName[] = "EquationSystem.g";
+
+/** \brief Return the name of the grammar file that generated this code.
+ */
+static const char * getGrammarFileName()
+{
+ return fileName;
+}
+
+/** \brief Create a new lexer called EquationSystemLexer
+ *
+ * \param[in] instream Pointer to an initialized input stream
+ * \return
+ * - Success pEquationSystemLexer initialized for the lex start
+ * - Fail NULL
+ */
+ANTLR3_API pEquationSystemLexer EquationSystemLexerNew
+(
+pANTLR3_INPUT_STREAM
+ instream)
+{
+ // See if we can create a new lexer with the standard constructor
+ //
+ return EquationSystemLexerNewSSD(instream, NULL);
+}
+
+/** \brief Create a new lexer called EquationSystemLexer
+ *
+ * \param[in] instream Pointer to an initialized input stream
+ * \param[state] state Previously created shared recognizer stat
+ * \return
+ * - Success pEquationSystemLexer initialized for the lex start
+ * - Fail NULL
+ */
+ANTLR3_API pEquationSystemLexer EquationSystemLexerNewSSD
+(pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
+{
+ pEquationSystemLexer ctx; // Context structure we will build and return
+
+ ctx = (pEquationSystemLexer) ANTLR3_CALLOC(1, sizeof(EquationSystemLexer));
+
+ if (ctx == NULL)
+ {
+ // Failed to allocate memory for lexer context
+ return NULL;
+ }
+
+ /* -------------------------------------------------------------------
+ * Memory for basic structure is allocated, now to fill in
+ * in base ANTLR3 structures. We initialize the function pointers
+ * for the standard ANTLR3 lexer function set, but upon return
+ * from here, the programmer may set the pointers to provide custom
+ * implementations of each function.
+ *
+ * We don't use the macros defined in EquationSystemLexer.h here so you can get a sense
+ * of what goes where.
+ */
+
+ /* Create a base lexer, using the supplied input stream
+ */
+ ctx->pLexer = antlr3LexerNewStream(ANTLR3_SIZE_HINT, instream, state);
+
+ /* Check that we allocated the memory correctly
+ */
+ if (ctx->pLexer == NULL)
+ {
+ ANTLR3_FREE(ctx);
+ return NULL;
+ }
+ /* Install the implementation of our EquationSystemLexer interface
+ */
+ ctx->mCOMMA = mCOMMA;
+ ctx->mGREATER_EQUAL = mGREATER_EQUAL;
+ ctx->mGUARD = mGUARD;
+ ctx->mMAXIMUM = mMAXIMUM;
+ ctx->mMINIMUM = mMINIMUM;
+ ctx->mMULT = mMULT;
+ ctx->mNEWLINE = mNEWLINE;
+ ctx->mPLUS = mPLUS;
+ ctx->mQUESTION_MARK = mQUESTION_MARK;
+ ctx->mSUB = mSUB;
+ ctx->mT__19 = mT__19;
+ ctx->mT__20 = mT__20;
+ ctx->mT__21 = mT__21;
+ ctx->mT__22 = mT__22;
+ ctx->mNUMBER = mNUMBER;
+ ctx->mVARIABLE = mVARIABLE;
+ ctx->mWHITESPACE = mWHITESPACE;
+ ctx->mDIGIT = mDIGIT;
+ ctx->mLETTER = mLETTER;
+ ctx->mTokens = mTokens;
+
+ /** When the nextToken() call is made to this lexer's pANTLR3_TOKEN_SOURCE
+ * it will call mTokens() in this generated code, and will pass it the ctx
+ * pointer of this lexer, not the context of the base lexer, so store that now.
+ */
+ ctx->pLexer->ctx = ctx;
+
+ /**Install the token matching function
+ */
+ ctx->pLexer->mTokens = (void (*) (void *))(mTokens);
+
+ ctx->getGrammarFileName = getGrammarFileName;
+ ctx->free = EquationSystemLexerFree;
+ ctx->reset = EquationSystemLexerReset;
+
+
+ /* Return the newly built lexer to the caller
+ */
+ return ctx;
+}
+/* =========================================================================
+ * Functions to match the lexer grammar defined tokens from the input stream
+ */
+
+// Comes from: 7:7: ( ';' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start COMMA
+ *
+ * Looks to match the characters the constitute the token COMMA
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mCOMMA(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = COMMA;
+
+
+ // EquationSystem.g:7:7: ( ';' )
+ // EquationSystem.g:7:9: ';'
+ {
+ MATCHC(';');
+ if (HASEXCEPTION())
+ {
+ goto ruleCOMMAEx;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleCOMMAEx; /* Prevent compiler warnings */
+ ruleCOMMAEx: ;
+
+}
+// $ANTLR end COMMA
+
+// Comes from: 8:15: ( '>=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start GREATER_EQUAL
+ *
+ * Looks to match the characters the constitute the token GREATER_EQUAL
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mGREATER_EQUAL(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = GREATER_EQUAL;
+
+
+ // EquationSystem.g:8:15: ( '>=' )
+ // EquationSystem.g:8:17: '>='
+ {
+ MATCHS(lit_1);
+ if (HASEXCEPTION())
+ {
+ goto ruleGREATER_EQUALEx;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleGREATER_EQUALEx; /* Prevent compiler warnings */
+ ruleGREATER_EQUALEx: ;
+
+}
+// $ANTLR end GREATER_EQUAL
+
+// Comes from: 9:7: ( 'guard' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start GUARD
+ *
+ * Looks to match the characters the constitute the token GUARD
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mGUARD(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = GUARD;
+
+
+ // EquationSystem.g:9:7: ( 'guard' )
+ // EquationSystem.g:9:9: 'guard'
+ {
+ MATCHS(lit_2);
+ if (HASEXCEPTION())
+ {
+ goto ruleGUARDEx;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleGUARDEx; /* Prevent compiler warnings */
+ ruleGUARDEx: ;
+
+}
+// $ANTLR end GUARD
+
+// Comes from: 10:9: ( 'max' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start MAXIMUM
+ *
+ * Looks to match the characters the constitute the token MAXIMUM
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mMAXIMUM(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = MAXIMUM;
+
+
+ // EquationSystem.g:10:9: ( 'max' )
+ // EquationSystem.g:10:11: 'max'
+ {
+ MATCHS(lit_3);
+ if (HASEXCEPTION())
+ {
+ goto ruleMAXIMUMEx;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleMAXIMUMEx; /* Prevent compiler warnings */
+ ruleMAXIMUMEx: ;
+
+}
+// $ANTLR end MAXIMUM
+
+// Comes from: 11:9: ( 'min' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start MINIMUM
+ *
+ * Looks to match the characters the constitute the token MINIMUM
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mMINIMUM(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = MINIMUM;
+
+
+ // EquationSystem.g:11:9: ( 'min' )
+ // EquationSystem.g:11:11: 'min'
+ {
+ MATCHS(lit_4);
+ if (HASEXCEPTION())
+ {
+ goto ruleMINIMUMEx;
+ }
+
+
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleMINIMUMEx; /* Prevent compiler warnings */
+ ruleMINIMUMEx: ;
+
+}
+// $ANTLR end MINIMUM
+
+// Comes from: 12:6: ( '*' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start MULT
+ *
+ * Looks to match the characters the constitute the token MULT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mMULT(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = MULT;
+
+
+ // EquationSystem.g:12:6: ( '*' )
+ // EquationSystem.g:12:8: '*'
+ {
+ MATCHC('*');
+ if (HASEXCEPTION())
+ {
+ goto ruleMULTEx;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleMULTEx; /* Prevent compiler warnings */
+ ruleMULTEx: ;
+
+}
+// $ANTLR end MULT
+
+// Comes from: 13:9: ( '\\n' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start NEWLINE
+ *
+ * Looks to match the characters the constitute the token NEWLINE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mNEWLINE(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = NEWLINE;
+
+
+ // EquationSystem.g:13:9: ( '\\n' )
+ // EquationSystem.g:13:11: '\\n'
+ {
+ MATCHC('\n');
+ if (HASEXCEPTION())
+ {
+ goto ruleNEWLINEEx;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleNEWLINEEx; /* Prevent compiler warnings */
+ ruleNEWLINEEx: ;
+
+}
+// $ANTLR end NEWLINE
+
+// Comes from: 14:6: ( '+' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start PLUS
+ *
+ * Looks to match the characters the constitute the token PLUS
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mPLUS(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = PLUS;
+
+
+ // EquationSystem.g:14:6: ( '+' )
+ // EquationSystem.g:14:8: '+'
+ {
+ MATCHC('+');
+ if (HASEXCEPTION())
+ {
+ goto rulePLUSEx;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto rulePLUSEx; /* Prevent compiler warnings */
+ rulePLUSEx: ;
+
+}
+// $ANTLR end PLUS
+
+// Comes from: 15:15: ( '?' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start QUESTION_MARK
+ *
+ * Looks to match the characters the constitute the token QUESTION_MARK
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mQUESTION_MARK(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = QUESTION_MARK;
+
+
+ // EquationSystem.g:15:15: ( '?' )
+ // EquationSystem.g:15:17: '?'
+ {
+ MATCHC('?');
+ if (HASEXCEPTION())
+ {
+ goto ruleQUESTION_MARKEx;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleQUESTION_MARKEx; /* Prevent compiler warnings */
+ ruleQUESTION_MARKEx: ;
+
+}
+// $ANTLR end QUESTION_MARK
+
+// Comes from: 16:5: ( '-' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start SUB
+ *
+ * Looks to match the characters the constitute the token SUB
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mSUB(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = SUB;
+
+
+ // EquationSystem.g:16:5: ( '-' )
+ // EquationSystem.g:16:7: '-'
+ {
+ MATCHC('-');
+ if (HASEXCEPTION())
+ {
+ goto ruleSUBEx;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleSUBEx; /* Prevent compiler warnings */
+ ruleSUBEx: ;
+
+}
+// $ANTLR end SUB
+
+// Comes from: 17:7: ( '(' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__19
+ *
+ * Looks to match the characters the constitute the token T__19
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__19(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__19;
+
+
+ // EquationSystem.g:17:7: ( '(' )
+ // EquationSystem.g:17:9: '('
+ {
+ MATCHC('(');
+ if (HASEXCEPTION())
+ {
+ goto ruleT__19Ex;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__19Ex; /* Prevent compiler warnings */
+ ruleT__19Ex: ;
+
+}
+// $ANTLR end T__19
+
+// Comes from: 18:7: ( ')' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__20
+ *
+ * Looks to match the characters the constitute the token T__20
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__20(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__20;
+
+
+ // EquationSystem.g:18:7: ( ')' )
+ // EquationSystem.g:18:9: ')'
+ {
+ MATCHC(')');
+ if (HASEXCEPTION())
+ {
+ goto ruleT__20Ex;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__20Ex; /* Prevent compiler warnings */
+ ruleT__20Ex: ;
+
+}
+// $ANTLR end T__20
+
+// Comes from: 19:7: ( ',' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__21
+ *
+ * Looks to match the characters the constitute the token T__21
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__21(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__21;
+
+
+ // EquationSystem.g:19:7: ( ',' )
+ // EquationSystem.g:19:9: ','
+ {
+ MATCHC(',');
+ if (HASEXCEPTION())
+ {
+ goto ruleT__21Ex;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__21Ex; /* Prevent compiler warnings */
+ ruleT__21Ex: ;
+
+}
+// $ANTLR end T__21
+
+// Comes from: 20:7: ( '=' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start T__22
+ *
+ * Looks to match the characters the constitute the token T__22
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mT__22(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = T__22;
+
+
+ // EquationSystem.g:20:7: ( '=' )
+ // EquationSystem.g:20:9: '='
+ {
+ MATCHC('=');
+ if (HASEXCEPTION())
+ {
+ goto ruleT__22Ex;
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleT__22Ex; /* Prevent compiler warnings */
+ ruleT__22Ex: ;
+
+}
+// $ANTLR end T__22
+
+// Comes from: 37:8: ( ( DIGIT )+ )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start NUMBER
+ *
+ * Looks to match the characters the constitute the token NUMBER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mNUMBER(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = NUMBER;
+
+
+ // EquationSystem.g:37:8: ( ( DIGIT )+ )
+ // EquationSystem.g:37:10: ( DIGIT )+
+ {
+ // EquationSystem.g:37:10: ( DIGIT )+
+ {
+ int cnt1=0;
+
+ for (;;)
+ {
+ int alt1=2;
+ switch ( LA(1) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ {
+ alt1=1;
+ }
+ break;
+
+ }
+
+ switch (alt1)
+ {
+ case 1:
+ // EquationSystem.g:
+ {
+ if ( ((LA(1) >= '0') && (LA(1) <= '9')) )
+ {
+ CONSUME();
+ }
+ else
+ {
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleNUMBEREx;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt1 >= 1 )
+ {
+ goto loop1;
+ }
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleNUMBEREx;
+ }
+ cnt1++;
+ }
+ loop1: ; /* Jump to here if this rule does not match */
+ }
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleNUMBEREx; /* Prevent compiler warnings */
+ ruleNUMBEREx: ;
+
+}
+// $ANTLR end NUMBER
+
+// Comes from: 38:9: ( ( LETTER ) ( LETTER | DIGIT )* )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start VARIABLE
+ *
+ * Looks to match the characters the constitute the token VARIABLE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mVARIABLE(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = VARIABLE;
+
+
+ // EquationSystem.g:38:9: ( ( LETTER ) ( LETTER | DIGIT )* )
+ // EquationSystem.g:38:11: ( LETTER ) ( LETTER | DIGIT )*
+ {
+ if ( ((LA(1) >= 'a') && (LA(1) <= 'z')) )
+ {
+ CONSUME();
+ }
+ else
+ {
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleVARIABLEEx;
+ }
+
+
+ // EquationSystem.g:38:20: ( LETTER | DIGIT )*
+
+ for (;;)
+ {
+ int alt2=2;
+ switch ( LA(1) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z':
+ {
+ alt2=1;
+ }
+ break;
+
+ }
+
+ switch (alt2)
+ {
+ case 1:
+ // EquationSystem.g:
+ {
+ if ( ((LA(1) >= '0') && (LA(1) <= '9')) || ((LA(1) >= 'a') && (LA(1) <= 'z')) )
+ {
+ CONSUME();
+ }
+ else
+ {
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleVARIABLEEx;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop2; /* break out of the loop */
+ break;
+ }
+ }
+ loop2: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleVARIABLEEx; /* Prevent compiler warnings */
+ ruleVARIABLEEx: ;
+
+}
+// $ANTLR end VARIABLE
+
+// Comes from: 39:12: ( ( '\\t' | ' ' | '\\u000C' )+ )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start WHITESPACE
+ *
+ * Looks to match the characters the constitute the token WHITESPACE
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mWHITESPACE(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+ _type = WHITESPACE;
+
+
+ // EquationSystem.g:39:12: ( ( '\\t' | ' ' | '\\u000C' )+ )
+ // EquationSystem.g:39:14: ( '\\t' | ' ' | '\\u000C' )+
+ {
+ // EquationSystem.g:39:14: ( '\\t' | ' ' | '\\u000C' )+
+ {
+ int cnt3=0;
+
+ for (;;)
+ {
+ int alt3=2;
+ switch ( LA(1) )
+ {
+ case '\t':
+ case '\f':
+ case ' ':
+ {
+ alt3=1;
+ }
+ break;
+
+ }
+
+ switch (alt3)
+ {
+ case 1:
+ // EquationSystem.g:
+ {
+ if ( LA(1) == '\t' || LA(1) == '\f' || LA(1) == ' ' )
+ {
+ CONSUME();
+ }
+ else
+ {
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleWHITESPACEEx;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt3 >= 1 )
+ {
+ goto loop3;
+ }
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleWHITESPACEEx;
+ }
+ cnt3++;
+ }
+ loop3: ; /* Jump to here if this rule does not match */
+ }
+
+ {
+
+ LEXSTATE->channel = HIDDEN;
+
+ }
+
+
+ }
+
+ LEXSTATE->type = _type;
+ // This is where rules clean up and exit
+ //
+ goto ruleWHITESPACEEx; /* Prevent compiler warnings */
+ ruleWHITESPACEEx: ;
+
+}
+// $ANTLR end WHITESPACE
+
+// Comes from: 46:7: ( '0' .. '9' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start DIGIT
+ *
+ * Looks to match the characters the constitute the token DIGIT
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mDIGIT(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // EquationSystem.g:46:7: ( '0' .. '9' )
+ // EquationSystem.g:
+ {
+ if ( ((LA(1) >= '0') && (LA(1) <= '9')) )
+ {
+ CONSUME();
+ }
+ else
+ {
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleDIGITEx;
+ }
+
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleDIGITEx; /* Prevent compiler warnings */
+ ruleDIGITEx: ;
+
+}
+// $ANTLR end DIGIT
+
+// Comes from: 48:7: ( 'a' .. 'z' )
+/** \brief Lexer rule generated by ANTLR3
+ *
+ * $ANTLR start LETTER
+ *
+ * Looks to match the characters the constitute the token LETTER
+ * from the attached input stream.
+ *
+ *
+ * \remark
+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
+ */
+static ANTLR3_INLINE
+void mLETTER(pEquationSystemLexer ctx)
+{
+ ANTLR3_UINT32 _type;
+
+
+ // EquationSystem.g:48:7: ( 'a' .. 'z' )
+ // EquationSystem.g:
+ {
+ if ( ((LA(1) >= 'a') && (LA(1) <= 'z')) )
+ {
+ CONSUME();
+ }
+ else
+ {
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+
+ LRECOVER();
+ goto ruleLETTEREx;
+ }
+
+
+ }
+
+
+ // This is where rules clean up and exit
+ //
+ goto ruleLETTEREx; /* Prevent compiler warnings */
+ ruleLETTEREx: ;
+
+}
+// $ANTLR end LETTER
+
+/** This is the entry point in to the lexer from an object that
+ * wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
+ */
+static void
+mTokens(pEquationSystemLexer ctx)
+{
+ {
+ // EquationSystem.g:1:8: ( COMMA | GREATER_EQUAL | GUARD | MAXIMUM | MINIMUM | MULT | NEWLINE | PLUS | QUESTION_MARK | SUB | T__19 | T__20 | T__21 | T__22 | NUMBER | VARIABLE | WHITESPACE )
+
+ ANTLR3_UINT32 alt4;
+
+ alt4=17;
+
+ switch ( LA(1) )
+ {
+ case ';':
+ {
+ alt4=1;
+ }
+ break;
+ case '>':
+ {
+ alt4=2;
+ }
+ break;
+ case 'g':
+ {
+ switch ( LA(2) )
+ {
+ case 'u':
+ {
+ switch ( LA(3) )
+ {
+ case 'a':
+ {
+ switch ( LA(4) )
+ {
+ case 'r':
+ {
+ switch ( LA(5) )
+ {
+ case 'd':
+ {
+ switch ( LA(6) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z':
+ {
+ alt4=16;
+ }
+ break;
+
+ default:
+ alt4=3;
+ }
+
+ }
+ break;
+
+ default:
+ alt4=16;
+ }
+
+ }
+ break;
+
+ default:
+ alt4=16;
+ }
+
+ }
+ break;
+
+ default:
+ alt4=16;
+ }
+
+ }
+ break;
+
+ default:
+ alt4=16;
+ }
+
+ }
+ break;
+ case 'm':
+ {
+ switch ( LA(2) )
+ {
+ case 'a':
+ {
+ switch ( LA(3) )
+ {
+ case 'x':
+ {
+ switch ( LA(4) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z':
+ {
+ alt4=16;
+ }
+ break;
+
+ default:
+ alt4=4;
+ }
+
+ }
+ break;
+
+ default:
+ alt4=16;
+ }
+
+ }
+ break;
+ case 'i':
+ {
+ switch ( LA(3) )
+ {
+ case 'n':
+ {
+ switch ( LA(4) )
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z':
+ {
+ alt4=16;
+ }
+ break;
+
+ default:
+ alt4=5;
+ }
+
+ }
+ break;
+
+ default:
+ alt4=16;
+ }
+
+ }
+ break;
+
+ default:
+ alt4=16;
+ }
+
+ }
+ break;
+ case '*':
+ {
+ alt4=6;
+ }
+ break;
+ case '\n':
+ {
+ alt4=7;
+ }
+ break;
+ case '+':
+ {
+ alt4=8;
+ }
+ break;
+ case '?':
+ {
+ alt4=9;
+ }
+ break;
+ case '-':
+ {
+ alt4=10;
+ }
+ break;
+ case '(':
+ {
+ alt4=11;
+ }
+ break;
+ case ')':
+ {
+ alt4=12;
+ }
+ break;
+ case ',':
+ {
+ alt4=13;
+ }
+ break;
+ case '=':
+ {
+ alt4=14;
+ }
+ break;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ {
+ alt4=15;
+ }
+ break;
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z':
+ {
+ alt4=16;
+ }
+ break;
+ case '\t':
+ case '\f':
+ case ' ':
+ {
+ alt4=17;
+ }
+ break;
+
+ default:
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 4;
+ EXCEPTION->state = 0;
+
+
+ goto ruleTokensEx;
+
+ }
+
+ switch (alt4)
+ {
+ case 1:
+ // EquationSystem.g:1:10: COMMA
+ {
+ /* 1:10: COMMA */
+ mCOMMA(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 2:
+ // EquationSystem.g:1:16: GREATER_EQUAL
+ {
+ /* 1:16: GREATER_EQUAL */
+ mGREATER_EQUAL(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 3:
+ // EquationSystem.g:1:30: GUARD
+ {
+ /* 1:30: GUARD */
+ mGUARD(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 4:
+ // EquationSystem.g:1:36: MAXIMUM
+ {
+ /* 1:36: MAXIMUM */
+ mMAXIMUM(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 5:
+ // EquationSystem.g:1:44: MINIMUM
+ {
+ /* 1:44: MINIMUM */
+ mMINIMUM(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 6:
+ // EquationSystem.g:1:52: MULT
+ {
+ /* 1:52: MULT */
+ mMULT(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 7:
+ // EquationSystem.g:1:57: NEWLINE
+ {
+ /* 1:57: NEWLINE */
+ mNEWLINE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 8:
+ // EquationSystem.g:1:65: PLUS
+ {
+ /* 1:65: PLUS */
+ mPLUS(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 9:
+ // EquationSystem.g:1:70: QUESTION_MARK
+ {
+ /* 1:70: QUESTION_MARK */
+ mQUESTION_MARK(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 10:
+ // EquationSystem.g:1:84: SUB
+ {
+ /* 1:84: SUB */
+ mSUB(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 11:
+ // EquationSystem.g:1:88: T__19
+ {
+ /* 1:88: T__19 */
+ mT__19(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 12:
+ // EquationSystem.g:1:94: T__20
+ {
+ /* 1:94: T__20 */
+ mT__20(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 13:
+ // EquationSystem.g:1:100: T__21
+ {
+ /* 1:100: T__21 */
+ mT__21(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 14:
+ // EquationSystem.g:1:106: T__22
+ {
+ /* 1:106: T__22 */
+ mT__22(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 15:
+ // EquationSystem.g:1:112: NUMBER
+ {
+ /* 1:112: NUMBER */
+ mNUMBER(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 16:
+ // EquationSystem.g:1:119: VARIABLE
+ {
+ /* 1:119: VARIABLE */
+ mVARIABLE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+ case 17:
+ // EquationSystem.g:1:128: WHITESPACE
+ {
+ /* 1:128: WHITESPACE */
+ mWHITESPACE(ctx );
+ if (HASEXCEPTION())
+ {
+ goto ruleTokensEx;
+ }
+
+
+
+ }
+ break;
+
+ }
+ }
+
+
+ goto ruleTokensEx; /* Prevent compiler warnings */
+ruleTokensEx: ;
+}
+
+/* =========================================================================
+ * Lexer matching rules end.
+ * =========================================================================
+ */
+/* End of Lexer code
+ * ================================================
+ * ================================================
+ */
+
+
+/* End of code
+ * =============================================================================
+ */
diff --git a/impl/parser/EquationSystemLexer.h b/impl/parser/EquationSystemLexer.h
new file mode 100644
index 0000000..e02f9a0
--- /dev/null
+++ b/impl/parser/EquationSystemLexer.h
@@ -0,0 +1,313 @@
+/** \file
+ * This C header file was generated by $ANTLR version 3.4
+ *
+ * - From the grammar source file : EquationSystem.g
+ * - On : 2012-07-12 15:47:53
+ * - for the lexer : EquationSystemLexerLexer
+ *
+ * Editing it, at least manually, is not wise.
+ *
+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
+ *
+ *
+ * The lexer
+EquationSystemLexer
+
+has the callable functions (rules) shown below,
+ * which will invoke the code for the associated rule in the source grammar
+ * assuming that the input stream is pointing to a token/text stream that could begin
+ * this rule.
+ *
+ * For instance if you call the first (topmost) rule in a parser grammar, you will
+ * get the results of a full parse, but calling a rule half way through the grammar will
+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
+ * in editors and so on.
+ *
+ * The parser entry points are called indirectly (by function pointer to function) via
+ * a parser context typedef pEquationSystemLexer, which is returned from a call to EquationSystemLexerNew().
+ *
+ * As this is a generated lexer, it is unlikely you will call it 'manually'. However
+ * the methods are provided anyway.
+ *
+ * The methods in pEquationSystemLexer are as follows:
+ *
+ * -
+ void
+ pEquationSystemLexer->COMMA(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->GREATER_EQUAL(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->GUARD(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->MAXIMUM(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->MINIMUM(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->MULT(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->NEWLINE(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->PLUS(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->QUESTION_MARK(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->SUB(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->T__19(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->T__20(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->T__21(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->T__22(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->NUMBER(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->VARIABLE(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->WHITESPACE(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->DIGIT(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->LETTER(pEquationSystemLexer)
+ * -
+ void
+ pEquationSystemLexer->Tokens(pEquationSystemLexer)
+ *
+ * The return type for any particular rule is of course determined by the source
+ * grammar file.
+ */
+// [The "BSD license"]
+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
+// http://www.temporal-wave.com
+// http://www.linkedin.com/in/jimidle
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. The name of the author may not be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef _EquationSystemLexer_H
+#define _EquationSystemLexer_H
+/* =============================================================================
+ * Standard antlr3 C runtime definitions
+ */
+#include <antlr3.h>
+
+/* End of standard antlr 3 runtime definitions
+ * =============================================================================
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Forward declare the context typedef so that we can use it before it is
+// properly defined. Delegators and delegates (from import statements) are
+// interdependent and their context structures contain pointers to each other
+// C only allows such things to be declared if you pre-declare the typedef.
+//
+typedef struct EquationSystemLexer_Ctx_struct EquationSystemLexer, * pEquationSystemLexer;
+
+
+
+#ifdef ANTLR3_WINDOWS
+// Disable: Unreferenced parameter, - Rules with parameters that are not used
+// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
+// initialized but unused variable - tree rewrite variables declared but not needed
+// Unreferenced local variable - lexer rule declares but does not always use _type
+// potentially unitialized variable used - retval always returned from a rule
+// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
+//
+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
+// this is a matter of orthogonality hence I disable that one.
+//
+#pragma warning( disable : 4100 )
+#pragma warning( disable : 4101 )
+#pragma warning( disable : 4127 )
+#pragma warning( disable : 4189 )
+#pragma warning( disable : 4505 )
+#pragma warning( disable : 4701 )
+#endif
+
+/** Context tracking structure for
+EquationSystemLexer
+
+ */
+struct EquationSystemLexer_Ctx_struct
+{
+ /** Built in ANTLR3 context tracker contains all the generic elements
+ * required for context tracking.
+ */
+ pANTLR3_LEXER pLexer;
+
+ void
+ (*mCOMMA) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mGREATER_EQUAL) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mGUARD) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mMAXIMUM) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mMINIMUM) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mMULT) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mNEWLINE) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mPLUS) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mQUESTION_MARK) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mSUB) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__19) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__20) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__21) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mT__22) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mNUMBER) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mVARIABLE) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mWHITESPACE) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mDIGIT) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mLETTER) (struct EquationSystemLexer_Ctx_struct * ctx);
+
+ void
+ (*mTokens) (struct EquationSystemLexer_Ctx_struct * ctx);
+ const char * (*getGrammarFileName)();
+ void (*reset) (struct EquationSystemLexer_Ctx_struct * ctx);
+ void (*free) (struct EquationSystemLexer_Ctx_struct * ctx);
+};
+
+// Function protoypes for the constructor functions that external translation units
+// such as delegators and delegates may wish to call.
+//
+ANTLR3_API pEquationSystemLexer EquationSystemLexerNew (
+pANTLR3_INPUT_STREAM
+ instream);
+ANTLR3_API pEquationSystemLexer EquationSystemLexerNewSSD (
+pANTLR3_INPUT_STREAM
+ instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
+
+/** Symbolic definitions of all the tokens that the
+lexer
+ will work with.
+ * \{
+ *
+ * Antlr will define EOF, but we can't use that as it it is too common in
+ * in C header files and that would be confusing. There is no way to filter this out at the moment
+ * so we just undef it here for now. That isn't the value we get back from C recognizers
+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
+ */
+#ifdef EOF
+#undef EOF
+#endif
+#ifdef Tokens
+#undef Tokens
+#endif
+#define EOF -1
+#define T__19 19
+#define T__20 20
+#define T__21 21
+#define T__22 22
+#define COMMA 4
+#define DIGIT 5
+#define GREATER_EQUAL 6
+#define GUARD 7
+#define LETTER 8
+#define MAXIMUM 9
+#define MINIMUM 10
+#define MULT 11
+#define NEWLINE 12
+#define NUMBER 13
+#define PLUS 14
+#define QUESTION_MARK 15
+#define SUB 16
+#define VARIABLE 17
+#define WHITESPACE 18
+#ifdef EOF
+#undef EOF
+#define EOF ANTLR3_TOKEN_EOF
+#endif
+
+#ifndef TOKENSOURCE
+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
+#endif
+
+/* End of token definitions for EquationSystemLexer
+ * =============================================================================
+ */
+/** } */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* END - Note:Keep extra line feed to satisfy UNIX systems */
diff --git a/impl/parser/EquationSystemLexer.o b/impl/parser/EquationSystemLexer.o
new file mode 100644
index 0000000..a0acfea
--- /dev/null
+++ b/impl/parser/EquationSystemLexer.o
Binary files differ
diff --git a/impl/parser/EquationSystemParser.c b/impl/parser/EquationSystemParser.c
new file mode 100644
index 0000000..8252c19
--- /dev/null
+++ b/impl/parser/EquationSystemParser.c
@@ -0,0 +1,2460 @@
+/** \file
+ * This C source file was generated by $ANTLR version 3.4
+ *
+ * - From the grammar source file : EquationSystem.g
+ * - On : 2012-07-12 15:47:50
+ * - for the parser : EquationSystemParserParser
+ *
+ * Editing it, at least manually, is not wise.
+ *
+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
+ *
+ *
+*/
+// [The "BSD license"]
+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
+// http://www.temporal-wave.com
+// http://www.linkedin.com/in/jimidle
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. The name of the author may not be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/* -----------------------------------------
+ * Include the ANTLR3 generated header file.
+ */
+#include "EquationSystemParser.h"
+/* ----------------------------------------- */
+
+
+
+
+
+/* MACROS that hide the C interface implementations from the
+ * generated code, which makes it a little more understandable to the human eye.
+ * I am very much against using C pre-processor macros for function calls and bits
+ * of code as you cannot see what is happening when single stepping in debuggers
+ * and so on. The exception (in my book at least) is for generated code, where you are
+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
+ * hides some indirect calls, but is always referring to the input stream. This is
+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
+ * the runtime interfaces without changing the generated code too often, without
+ * confusing the reader of the generated output, who may not wish to know the gory
+ * details of the interface inheritance.
+ */
+
+#define CTX ctx
+
+/* Aids in accessing scopes for grammar programmers
+ */
+#undef SCOPE_TYPE
+#undef SCOPE_STACK
+#undef SCOPE_TOP
+#define SCOPE_TYPE(scope) pEquationSystemParser_##scope##_SCOPE
+#define SCOPE_STACK(scope) pEquationSystemParser_##scope##Stack
+#define SCOPE_TOP(scope) ctx->pEquationSystemParser_##scope##Top
+#define SCOPE_SIZE(scope) ctx->pEquationSystemParser_##scope##Stack_limit
+#define SCOPE_INSTANCE(scope, i) (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
+
+/* Macros for accessing things in the parser
+ */
+
+#undef PARSER
+#undef RECOGNIZER
+#undef HAVEPARSEDRULE
+#undef MEMOIZE
+#undef INPUT
+#undef STRSTREAM
+#undef HASEXCEPTION
+#undef EXCEPTION
+#undef MATCHT
+#undef MATCHANYT
+#undef FOLLOWSTACK
+#undef FOLLOWPUSH
+#undef FOLLOWPOP
+#undef PRECOVER
+#undef PREPORTERROR
+#undef LA
+#undef LT
+#undef CONSTRUCTEX
+#undef CONSUME
+#undef MARK
+#undef REWIND
+#undef REWINDLAST
+#undef PERRORRECOVERY
+#undef HASFAILED
+#undef FAILEDFLAG
+#undef RECOVERFROMMISMATCHEDSET
+#undef RECOVERFROMMISMATCHEDELEMENT
+#undef INDEX
+#undef ADAPTOR
+#undef SEEK
+#undef RULEMEMO
+#undef DBG
+
+#define PARSER ctx->pParser
+#define RECOGNIZER PARSER->rec
+#define PSRSTATE RECOGNIZER->state
+#define HAVEPARSEDRULE(r) RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
+#define MEMOIZE(ri,si) RECOGNIZER->memoize(RECOGNIZER, ri, si)
+#define INPUT PARSER->tstream
+#define STRSTREAM INPUT
+#define ISTREAM INPUT->istream
+#define INDEX() ISTREAM->index(INPUT->istream)
+#define HASEXCEPTION() (PSRSTATE->error == ANTLR3_TRUE)
+#define EXCEPTION PSRSTATE->exception
+#define MATCHT(t, fs) RECOGNIZER->match(RECOGNIZER, t, fs)
+#define MATCHANYT() RECOGNIZER->matchAny(RECOGNIZER)
+#define FOLLOWSTACK PSRSTATE->following
+#ifdef SKIP_FOLLOW_SETS
+#define FOLLOWPUSH(x)
+#define FOLLOWPOP()
+#else
+#define FOLLOWPUSH(x) FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
+#define FOLLOWPOP() FOLLOWSTACK->pop(FOLLOWSTACK)
+#endif
+#define PRECOVER() RECOGNIZER->recover(RECOGNIZER)
+#define PREPORTERROR() RECOGNIZER->reportError(RECOGNIZER)
+#define LA(n) INPUT->istream->_LA(ISTREAM, n)
+#define LT(n) INPUT->_LT(INPUT, n)
+#define CONSTRUCTEX() RECOGNIZER->exConstruct(RECOGNIZER)
+#define CONSUME() ISTREAM->consume(ISTREAM)
+#define MARK() ISTREAM->mark(ISTREAM)
+#define REWIND(m) ISTREAM->rewind(ISTREAM, m)
+#define REWINDLAST() ISTREAM->rewindLast(ISTREAM)
+#define SEEK(n) ISTREAM->seek(ISTREAM, n)
+#define PERRORRECOVERY PSRSTATE->errorRecovery
+#define FAILEDFLAG PSRSTATE->failed
+#define HASFAILED() (FAILEDFLAG == ANTLR3_TRUE)
+#define BACKTRACKING PSRSTATE->backtracking
+#define RECOVERFROMMISMATCHEDSET(s) RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
+#define RECOVERFROMMISMATCHEDELEMENT(e) RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
+#define ADAPTOR ctx->adaptor
+#define RULEMEMO PSRSTATE->ruleMemo
+#define DBG RECOGNIZER->debugger
+
+
+#define TOKTEXT(tok, txt) tok, (pANTLR3_UINT8)txt
+
+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
+ * then for the present you must use different names for your defines as these are hard coded
+ * in the code generator. It would be better not to use such names internally, and maybe
+ * we can change this in a forthcoming release. I deliberately do not #undef these
+ * here as this will at least give you a redefined error somewhere if they clash.
+ */
+#define UP ANTLR3_TOKEN_UP
+#define DOWN ANTLR3_TOKEN_DOWN
+#define EOR ANTLR3_TOKEN_EOR
+#define INVALID ANTLR3_TOKEN_INVALID
+
+
+/* =============================================================================
+ * Functions to create and destroy scopes. First come the rule scopes, followed
+ * by the global declared scopes.
+ */
+
+
+
+/* ============================================================================= */
+
+/* =============================================================================
+ * Start of recognizer
+ */
+
+
+/** \brief Table of all token names in symbolic order, mainly used for
+ * error reporting.
+ */
+pANTLR3_UINT8 EquationSystemParserTokenNames[19+4]
+ = {
+ (pANTLR3_UINT8) "<invalid>", /* String to print to indicate an invalid token */
+ (pANTLR3_UINT8) "<EOR>",
+ (pANTLR3_UINT8) "<DOWN>",
+ (pANTLR3_UINT8) "<UP>",
+ (pANTLR3_UINT8) "COMMA",
+ (pANTLR3_UINT8) "DIGIT",
+ (pANTLR3_UINT8) "GREATER_EQUAL",
+ (pANTLR3_UINT8) "GUARD",
+ (pANTLR3_UINT8) "LETTER",
+ (pANTLR3_UINT8) "MAXIMUM",
+ (pANTLR3_UINT8) "MINIMUM",
+ (pANTLR3_UINT8) "MULT",
+ (pANTLR3_UINT8) "NEWLINE",
+ (pANTLR3_UINT8) "NUMBER",
+ (pANTLR3_UINT8) "PLUS",
+ (pANTLR3_UINT8) "QUESTION_MARK",
+ (pANTLR3_UINT8) "SUB",
+ (pANTLR3_UINT8) "VARIABLE",
+ (pANTLR3_UINT8) "WHITESPACE",
+ (pANTLR3_UINT8) "'('",
+ (pANTLR3_UINT8) "')'",
+ (pANTLR3_UINT8) "','",
+ (pANTLR3_UINT8) "'='"
+ };
+
+
+
+// Forward declare the locally static matching functions we have generated.
+//
+static
+ EquationSystemParser_equation_system_return
+ equation_system (pEquationSystemParser ctx);
+static
+ EquationSystemParser_equation_return
+ equation (pEquationSystemParser ctx);
+static
+ EquationSystemParser_maxExpr_return
+ maxExpr (pEquationSystemParser ctx);
+static
+ EquationSystemParser_minExpr_return
+ minExpr (pEquationSystemParser ctx);
+static
+ EquationSystemParser_expr_return
+ expr (pEquationSystemParser ctx);
+static
+ EquationSystemParser_term_return
+ term (pEquationSystemParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred8_EquationSystem (pEquationSystemParser ctx);
+static
+ ANTLR3_BOOLEAN
+ synpred12_EquationSystem (pEquationSystemParser ctx);
+static void EquationSystemParserFree(pEquationSystemParser ctx);
+static void EquationSystemParserReset (pEquationSystemParser ctx);
+
+/* For use in tree output where we are accumulating rule labels via label += ruleRef
+ * we need a function that knows how to free a return scope when the list is destroyed.
+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
+ */
+static void ANTLR3_CDECL freeScope(void * scope)
+{
+ ANTLR3_FREE(scope);
+}
+
+/** \brief Name of the grammar file that generated this code
+ */
+static const char fileName[] = "EquationSystem.g";
+
+/** \brief Return the name of the grammar file that generated this code.
+ */
+static const char * getGrammarFileName()
+{
+ return fileName;
+}
+/** \brief Create a new EquationSystemParser parser and return a context for it.
+ *
+ * \param[in] instream Pointer to an input stream interface.
+ *
+ * \return Pointer to new parser context upon success.
+ */
+ANTLR3_API pEquationSystemParser
+EquationSystemParserNew (pANTLR3_COMMON_TOKEN_STREAM instream)
+{
+ // See if we can create a new parser with the standard constructor
+ //
+ return EquationSystemParserNewSSD(instream, NULL);
+}
+
+/** \brief Create a new EquationSystemParser parser and return a context for it.
+ *
+ * \param[in] instream Pointer to an input stream interface.
+ *
+ * \return Pointer to new parser context upon success.
+ */
+ANTLR3_API pEquationSystemParser
+EquationSystemParserNewSSD (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
+{
+ pEquationSystemParser ctx; /* Context structure we will build and return */
+
+ ctx = (pEquationSystemParser) ANTLR3_CALLOC(1, sizeof(EquationSystemParser));
+
+ if (ctx == NULL)
+ {
+ // Failed to allocate memory for parser context
+ //
+ return NULL;
+ }
+
+ /* -------------------------------------------------------------------
+ * Memory for basic structure is allocated, now to fill in
+ * the base ANTLR3 structures. We initialize the function pointers
+ * for the standard ANTLR3 parser function set, but upon return
+ * from here, the programmer may set the pointers to provide custom
+ * implementations of each function.
+ *
+ * We don't use the macros defined in EquationSystemParser.h here, in order that you can get a sense
+ * of what goes where.
+ */
+
+ /* Create a base parser/recognizer, using the supplied token stream
+ */
+ ctx->pParser = antlr3ParserNewStream(ANTLR3_SIZE_HINT, instream->tstream, state);
+ /* Install the implementation of our EquationSystemParser interface
+ */
+ ctx->equation_system = equation_system;
+ ctx->equation = equation;
+ ctx->maxExpr = maxExpr;
+ ctx->minExpr = minExpr;
+ ctx->expr = expr;
+ ctx->term = term;
+ ctx->synpred8_EquationSystem = synpred8_EquationSystem;
+ ctx->synpred12_EquationSystem = synpred12_EquationSystem;
+ ctx->free = EquationSystemParserFree;
+ ctx->reset = EquationSystemParserReset;
+ ctx->getGrammarFileName = getGrammarFileName;
+
+ /* Install the scope pushing methods.
+ */
+ADAPTOR = ANTLR3_TREE_ADAPTORNew(instream->tstream->tokenSource->strFactory);
+
+ctx->vectors = antlr3VectorFactoryNew(0);
+ /* Install the token table
+ */
+ PSRSTATE->tokenNames = EquationSystemParserTokenNames;
+
+
+ /* Return the newly built parser to the caller
+ */
+ return ctx;
+}
+
+static void
+EquationSystemParserReset (pEquationSystemParser ctx)
+{
+ RECOGNIZER->reset(RECOGNIZER);
+}
+
+/** Free the parser resources
+ */
+ static void
+ EquationSystemParserFree(pEquationSystemParser ctx)
+ {
+ /* Free any scope memory
+ */
+
+ctx->vectors->close(ctx->vectors);
+/* We created the adaptor so we must free it
+ */
+ADAPTOR->free(ADAPTOR);
+ // Free this parser
+ //
+ ctx->pParser->free(ctx->pParser);
+
+
+ ANTLR3_FREE(ctx);
+
+ /* Everything is released, so we can return
+ */
+ return;
+ }
+
+/** Return token names used by this
+parser
+
+ *
+ * The returned pointer is used as an index into the token names table (using the token
+ * number as the index).
+ *
+ * \return Pointer to first char * in the table.
+ */
+static pANTLR3_UINT8 *getTokenNames()
+{
+ return EquationSystemParserTokenNames;
+}
+
+
+/* Declare the bitsets
+ */
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_equation_in_equation_system141 */
+static ANTLR3_BITWORD FOLLOW_equation_in_equation_system141_bits[] = { ANTLR3_UINT64_LIT(0x0000000000001002) };
+static ANTLR3_BITSET_LIST FOLLOW_equation_in_equation_system141 = { FOLLOW_equation_in_equation_system141_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NEWLINE_in_equation_system145 */
+static ANTLR3_BITWORD FOLLOW_NEWLINE_in_equation_system145_bits[] = { ANTLR3_UINT64_LIT(0x0000000000021000) };
+static ANTLR3_BITSET_LIST FOLLOW_NEWLINE_in_equation_system145 = { FOLLOW_NEWLINE_in_equation_system145_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_equation_in_equation_system150 */
+static ANTLR3_BITWORD FOLLOW_equation_in_equation_system150_bits[] = { ANTLR3_UINT64_LIT(0x0000000000001002) };
+static ANTLR3_BITSET_LIST FOLLOW_equation_in_equation_system150 = { FOLLOW_equation_in_equation_system150_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NEWLINE_in_equation_system157 */
+static ANTLR3_BITWORD FOLLOW_NEWLINE_in_equation_system157_bits[] = { ANTLR3_UINT64_LIT(0x0000000000001002) };
+static ANTLR3_BITSET_LIST FOLLOW_NEWLINE_in_equation_system157 = { FOLLOW_NEWLINE_in_equation_system157_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_VARIABLE_in_equation168 */
+static ANTLR3_BITWORD FOLLOW_VARIABLE_in_equation168_bits[] = { ANTLR3_UINT64_LIT(0x0000000000400000) };
+static ANTLR3_BITSET_LIST FOLLOW_VARIABLE_in_equation168 = { FOLLOW_VARIABLE_in_equation168_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_22_in_equation170 */
+static ANTLR3_BITWORD FOLLOW_22_in_equation170_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2600) };
+static ANTLR3_BITSET_LIST FOLLOW_22_in_equation170 = { FOLLOW_22_in_equation170_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_maxExpr_in_equation173 */
+static ANTLR3_BITWORD FOLLOW_maxExpr_in_equation173_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_maxExpr_in_equation173 = { FOLLOW_maxExpr_in_equation173_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MAXIMUM_in_maxExpr182 */
+static ANTLR3_BITWORD FOLLOW_MAXIMUM_in_maxExpr182_bits[] = { ANTLR3_UINT64_LIT(0x0000000000080000) };
+static ANTLR3_BITSET_LIST FOLLOW_MAXIMUM_in_maxExpr182 = { FOLLOW_MAXIMUM_in_maxExpr182_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_19_in_maxExpr185 */
+static ANTLR3_BITWORD FOLLOW_19_in_maxExpr185_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2400) };
+static ANTLR3_BITSET_LIST FOLLOW_19_in_maxExpr185 = { FOLLOW_19_in_maxExpr185_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_minExpr_in_maxExpr188 */
+static ANTLR3_BITWORD FOLLOW_minExpr_in_maxExpr188_bits[] = { ANTLR3_UINT64_LIT(0x0000000000300000) };
+static ANTLR3_BITSET_LIST FOLLOW_minExpr_in_maxExpr188 = { FOLLOW_minExpr_in_maxExpr188_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_21_in_maxExpr192 */
+static ANTLR3_BITWORD FOLLOW_21_in_maxExpr192_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2400) };
+static ANTLR3_BITSET_LIST FOLLOW_21_in_maxExpr192 = { FOLLOW_21_in_maxExpr192_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_minExpr_in_maxExpr195 */
+static ANTLR3_BITWORD FOLLOW_minExpr_in_maxExpr195_bits[] = { ANTLR3_UINT64_LIT(0x0000000000300000) };
+static ANTLR3_BITSET_LIST FOLLOW_minExpr_in_maxExpr195 = { FOLLOW_minExpr_in_maxExpr195_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_20_in_maxExpr200 */
+static ANTLR3_BITWORD FOLLOW_20_in_maxExpr200_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_20_in_maxExpr200 = { FOLLOW_20_in_maxExpr200_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_minExpr_in_maxExpr205 */
+static ANTLR3_BITWORD FOLLOW_minExpr_in_maxExpr205_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_minExpr_in_maxExpr205 = { FOLLOW_minExpr_in_maxExpr205_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MINIMUM_in_minExpr213 */
+static ANTLR3_BITWORD FOLLOW_MINIMUM_in_minExpr213_bits[] = { ANTLR3_UINT64_LIT(0x0000000000080000) };
+static ANTLR3_BITSET_LIST FOLLOW_MINIMUM_in_minExpr213 = { FOLLOW_MINIMUM_in_minExpr213_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_19_in_minExpr216 */
+static ANTLR3_BITWORD FOLLOW_19_in_minExpr216_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2600) };
+static ANTLR3_BITSET_LIST FOLLOW_19_in_minExpr216 = { FOLLOW_19_in_minExpr216_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_maxExpr_in_minExpr219 */
+static ANTLR3_BITWORD FOLLOW_maxExpr_in_minExpr219_bits[] = { ANTLR3_UINT64_LIT(0x0000000000300000) };
+static ANTLR3_BITSET_LIST FOLLOW_maxExpr_in_minExpr219 = { FOLLOW_maxExpr_in_minExpr219_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_21_in_minExpr223 */
+static ANTLR3_BITWORD FOLLOW_21_in_minExpr223_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2600) };
+static ANTLR3_BITSET_LIST FOLLOW_21_in_minExpr223 = { FOLLOW_21_in_minExpr223_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_maxExpr_in_minExpr226 */
+static ANTLR3_BITWORD FOLLOW_maxExpr_in_minExpr226_bits[] = { ANTLR3_UINT64_LIT(0x0000000000300000) };
+static ANTLR3_BITSET_LIST FOLLOW_maxExpr_in_minExpr226 = { FOLLOW_maxExpr_in_minExpr226_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_20_in_minExpr231 */
+static ANTLR3_BITWORD FOLLOW_20_in_minExpr231_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_20_in_minExpr231 = { FOLLOW_20_in_minExpr231_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_minExpr236 */
+static ANTLR3_BITWORD FOLLOW_expr_in_minExpr236_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expr_in_minExpr236 = { FOLLOW_expr_in_minExpr236_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_19_in_expr245 */
+static ANTLR3_BITWORD FOLLOW_19_in_expr245_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2000) };
+static ANTLR3_BITSET_LIST FOLLOW_19_in_expr245 = { FOLLOW_19_in_expr245_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr247 */
+static ANTLR3_BITWORD FOLLOW_expr_in_expr247_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000040) };
+static ANTLR3_BITSET_LIST FOLLOW_expr_in_expr247 = { FOLLOW_expr_in_expr247_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GREATER_EQUAL_in_expr249 */
+static ANTLR3_BITWORD FOLLOW_GREATER_EQUAL_in_expr249_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2000) };
+static ANTLR3_BITSET_LIST FOLLOW_GREATER_EQUAL_in_expr249 = { FOLLOW_GREATER_EQUAL_in_expr249_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr251 */
+static ANTLR3_BITWORD FOLLOW_expr_in_expr251_bits[] = { ANTLR3_UINT64_LIT(0x0000000000008000) };
+static ANTLR3_BITSET_LIST FOLLOW_expr_in_expr251 = { FOLLOW_expr_in_expr251_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_QUESTION_MARK_in_expr253 */
+static ANTLR3_BITWORD FOLLOW_QUESTION_MARK_in_expr253_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2000) };
+static ANTLR3_BITSET_LIST FOLLOW_QUESTION_MARK_in_expr253 = { FOLLOW_QUESTION_MARK_in_expr253_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr255 */
+static ANTLR3_BITWORD FOLLOW_expr_in_expr255_bits[] = { ANTLR3_UINT64_LIT(0x0000000000100000) };
+static ANTLR3_BITSET_LIST FOLLOW_expr_in_expr255 = { FOLLOW_expr_in_expr255_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_20_in_expr257 */
+static ANTLR3_BITWORD FOLLOW_20_in_expr257_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_20_in_expr257 = { FOLLOW_20_in_expr257_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_expr278 */
+static ANTLR3_BITWORD FOLLOW_term_in_expr278_bits[] = { ANTLR3_UINT64_LIT(0x0000000000014812) };
+static ANTLR3_BITSET_LIST FOLLOW_term_in_expr278 = { FOLLOW_term_in_expr278_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_expr282 */
+static ANTLR3_BITWORD FOLLOW_set_in_expr282_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_expr282 = { FOLLOW_set_in_expr282_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr299 */
+static ANTLR3_BITWORD FOLLOW_expr_in_expr299_bits[] = { ANTLR3_UINT64_LIT(0x0000000000014812) };
+static ANTLR3_BITSET_LIST FOLLOW_expr_in_expr299 = { FOLLOW_expr_in_expr299_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NUMBER_in_term311 */
+static ANTLR3_BITWORD FOLLOW_NUMBER_in_term311_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_NUMBER_in_term311 = { FOLLOW_NUMBER_in_term311_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_VARIABLE_in_term320 */
+static ANTLR3_BITWORD FOLLOW_VARIABLE_in_term320_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_VARIABLE_in_term320 = { FOLLOW_VARIABLE_in_term320_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_SUB_in_term329 */
+static ANTLR3_BITWORD FOLLOW_SUB_in_term329_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2000) };
+static ANTLR3_BITSET_LIST FOLLOW_SUB_in_term329 = { FOLLOW_SUB_in_term329_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_term332 */
+static ANTLR3_BITWORD FOLLOW_term_in_term332_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_term_in_term332 = { FOLLOW_term_in_term332_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_19_in_term341 */
+static ANTLR3_BITWORD FOLLOW_19_in_term341_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2000) };
+static ANTLR3_BITSET_LIST FOLLOW_19_in_term341 = { FOLLOW_19_in_term341_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_term344 */
+static ANTLR3_BITWORD FOLLOW_expr_in_term344_bits[] = { ANTLR3_UINT64_LIT(0x0000000000100000) };
+static ANTLR3_BITSET_LIST FOLLOW_expr_in_term344 = { FOLLOW_expr_in_term344_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_20_in_term346 */
+static ANTLR3_BITWORD FOLLOW_20_in_term346_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_20_in_term346 = { FOLLOW_20_in_term346_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_19_in_synpred8_EquationSystem245 */
+static ANTLR3_BITWORD FOLLOW_19_in_synpred8_EquationSystem245_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2000) };
+static ANTLR3_BITSET_LIST FOLLOW_19_in_synpred8_EquationSystem245 = { FOLLOW_19_in_synpred8_EquationSystem245_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_synpred8_EquationSystem247 */
+static ANTLR3_BITWORD FOLLOW_expr_in_synpred8_EquationSystem247_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000040) };
+static ANTLR3_BITSET_LIST FOLLOW_expr_in_synpred8_EquationSystem247 = { FOLLOW_expr_in_synpred8_EquationSystem247_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GREATER_EQUAL_in_synpred8_EquationSystem249 */
+static ANTLR3_BITWORD FOLLOW_GREATER_EQUAL_in_synpred8_EquationSystem249_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2000) };
+static ANTLR3_BITSET_LIST FOLLOW_GREATER_EQUAL_in_synpred8_EquationSystem249 = { FOLLOW_GREATER_EQUAL_in_synpred8_EquationSystem249_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_synpred8_EquationSystem251 */
+static ANTLR3_BITWORD FOLLOW_expr_in_synpred8_EquationSystem251_bits[] = { ANTLR3_UINT64_LIT(0x0000000000008000) };
+static ANTLR3_BITSET_LIST FOLLOW_expr_in_synpred8_EquationSystem251 = { FOLLOW_expr_in_synpred8_EquationSystem251_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_QUESTION_MARK_in_synpred8_EquationSystem253 */
+static ANTLR3_BITWORD FOLLOW_QUESTION_MARK_in_synpred8_EquationSystem253_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2000) };
+static ANTLR3_BITSET_LIST FOLLOW_QUESTION_MARK_in_synpred8_EquationSystem253 = { FOLLOW_QUESTION_MARK_in_synpred8_EquationSystem253_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_synpred8_EquationSystem255 */
+static ANTLR3_BITWORD FOLLOW_expr_in_synpred8_EquationSystem255_bits[] = { ANTLR3_UINT64_LIT(0x0000000000100000) };
+static ANTLR3_BITSET_LIST FOLLOW_expr_in_synpred8_EquationSystem255 = { FOLLOW_expr_in_synpred8_EquationSystem255_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_20_in_synpred8_EquationSystem257 */
+static ANTLR3_BITWORD FOLLOW_20_in_synpred8_EquationSystem257_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_20_in_synpred8_EquationSystem257 = { FOLLOW_20_in_synpred8_EquationSystem257_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_synpred12_EquationSystem282 */
+static ANTLR3_BITWORD FOLLOW_set_in_synpred12_EquationSystem282_bits[] = { ANTLR3_UINT64_LIT(0x00000000000B2000) };
+static ANTLR3_BITSET_LIST FOLLOW_set_in_synpred12_EquationSystem282 = { FOLLOW_set_in_synpred12_EquationSystem282_bits, 1 };
+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_synpred12_EquationSystem299 */
+static ANTLR3_BITWORD FOLLOW_expr_in_synpred12_EquationSystem299_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
+static ANTLR3_BITSET_LIST FOLLOW_expr_in_synpred12_EquationSystem299 = { FOLLOW_expr_in_synpred12_EquationSystem299_bits, 1 };
+
+
+
+/* =========================================================================
+ * DFA tables for the parser
+ */
+/** Static dfa state tables for Cyclic dfa:
+ * ()* loopback of 22:28: ( ( NEWLINE !)+ equation )*
+ */
+static const ANTLR3_INT32 dfa2_eot[4] =
+ {
+ -1, -1, -1, -1
+ };
+static const ANTLR3_INT32 dfa2_eof[4] =
+ {
+ 2, 2, -1, -1
+ };
+static const ANTLR3_INT32 dfa2_min[4] =
+ {
+ 12, 12, -1, -1
+ };
+static const ANTLR3_INT32 dfa2_max[4] =
+ {
+ 12, 17, -1, -1
+ };
+static const ANTLR3_INT32 dfa2_accept[4] =
+ {
+ -1, -1, 2, 1
+ };
+static const ANTLR3_INT32 dfa2_special[4] =
+ {
+ -1, -1, -1, -1
+ };
+
+/** Used when there is no transition table entry for a particular state */
+#define dfa2_T_empty NULL
+
+static const ANTLR3_INT32 dfa2_T0[] =
+ {
+ 1
+ };
+
+static const ANTLR3_INT32 dfa2_T1[] =
+ {
+ 1, -1, -1, -1, -1, 3
+ };
+
+
+/* Transition tables are a table of sub tables, with some tables
+ * reused for efficiency.
+ */
+static const ANTLR3_INT32 * const dfa2_transitions[] =
+{
+ dfa2_T0, dfa2_T1, NULL, NULL
+};
+
+
+/* Declare tracking structure for Cyclic DFA 2
+ */
+static
+ANTLR3_CYCLIC_DFA cdfa2
+ = {
+ 2, /* Decision number of this dfa */
+ /* Which decision this represents: */
+ (const pANTLR3_UCHAR)"()* loopback of 22:28: ( ( NEWLINE !)+ equation )*",
+ (CDFA_SPECIAL_FUNC) antlr3dfaspecialStateTransition, /* Default special state transition function */
+
+ antlr3dfaspecialTransition, /* DFA specialTransition is currently just a default function in the runtime */
+ antlr3dfapredict, /* DFA simulator function is in the runtime */
+ dfa2_eot, /* EOT table */
+ dfa2_eof, /* EOF table */
+ dfa2_min, /* Minimum tokens for each state */
+ dfa2_max, /* Maximum tokens for each state */
+ dfa2_accept, /* Accept table */
+ dfa2_special, /* Special transition states */
+ dfa2_transitions /* Table of transition tables */
+
+ };
+/* End of Cyclic DFA 2
+ * ---------------------
+ */
+/* =========================================================================
+ * End of DFA tables for the parser
+ */
+
+/* ==============================================
+ * Parsing rules
+ */
+/**
+ * $ANTLR start equation_system
+ * EquationSystem.g:22:1: equation_system : equation ( ( NEWLINE !)+ equation )* ( NEWLINE !)* ;
+ */
+static EquationSystemParser_equation_system_return
+equation_system(pEquationSystemParser ctx)
+{
+ EquationSystemParser_equation_system_return retval;
+
+
+ pANTLR3_BASE_TREE root_0;
+
+ pANTLR3_COMMON_TOKEN NEWLINE2;
+ pANTLR3_COMMON_TOKEN NEWLINE4;
+ EquationSystemParser_equation_return equation1;
+ #undef RETURN_TYPE_equation1
+ #define RETURN_TYPE_equation1 EquationSystemParser_equation_return
+
+ EquationSystemParser_equation_return equation3;
+ #undef RETURN_TYPE_equation3
+ #define RETURN_TYPE_equation3 EquationSystemParser_equation_return
+
+ pANTLR3_BASE_TREE NEWLINE2_tree;
+ pANTLR3_BASE_TREE NEWLINE4_tree;
+
+ /* Initialize rule variables
+ */
+
+ root_0 = NULL;
+
+ NEWLINE2 = NULL;
+ NEWLINE4 = NULL;
+ equation1.tree = NULL;
+
+ equation3.tree = NULL;
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ NEWLINE2_tree = NULL;
+ NEWLINE4_tree = NULL;
+
+
+ retval.tree = NULL;
+
+ {
+ // EquationSystem.g:22:17: ( equation ( ( NEWLINE !)+ equation )* ( NEWLINE !)* )
+ // EquationSystem.g:22:19: equation ( ( NEWLINE !)+ equation )* ( NEWLINE !)*
+ {
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
+
+
+ FOLLOWPUSH(FOLLOW_equation_in_equation_system141);
+ equation1=equation(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleequation_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, equation1.tree);
+
+ // EquationSystem.g:22:28: ( ( NEWLINE !)+ equation )*
+
+ for (;;)
+ {
+ int alt2=2;
+ alt2 = cdfa2.predict(ctx, RECOGNIZER, ISTREAM, &cdfa2);
+ if (HASEXCEPTION())
+ {
+ goto ruleequation_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ switch (alt2)
+ {
+ case 1:
+ // EquationSystem.g:22:30: ( NEWLINE !)+ equation
+ {
+ // EquationSystem.g:22:37: ( NEWLINE !)+
+ {
+ int cnt1=0;
+
+ for (;;)
+ {
+ int alt1=2;
+ switch ( LA(1) )
+ {
+ case NEWLINE:
+ {
+ alt1=1;
+ }
+ break;
+
+ }
+
+ switch (alt1)
+ {
+ case 1:
+ // EquationSystem.g:22:37: NEWLINE !
+ {
+ NEWLINE2 = (pANTLR3_COMMON_TOKEN) MATCHT(NEWLINE, &FOLLOW_NEWLINE_in_equation_system145);
+ if (HASEXCEPTION())
+ {
+ goto ruleequation_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ }
+ break;
+
+ default:
+
+ if ( cnt1 >= 1 )
+ {
+ goto loop1;
+ }
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ /* mismatchedSetEx()
+ */
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
+
+
+ goto ruleequation_systemEx;
+ }
+ cnt1++;
+ }
+ loop1: ; /* Jump to here if this rule does not match */
+ }
+
+ FOLLOWPUSH(FOLLOW_equation_in_equation_system150);
+ equation3=equation(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleequation_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, equation3.tree);
+
+ }
+ break;
+
+ default:
+ goto loop2; /* break out of the loop */
+ break;
+ }
+ }
+ loop2: ; /* Jump out to here if this rule does not match */
+
+
+ // EquationSystem.g:22:54: ( NEWLINE !)*
+
+ for (;;)
+ {
+ int alt3=2;
+ switch ( LA(1) )
+ {
+ case NEWLINE:
+ {
+ alt3=1;
+ }
+ break;
+
+ }
+
+ switch (alt3)
+ {
+ case 1:
+ // EquationSystem.g:22:55: NEWLINE !
+ {
+ NEWLINE4 = (pANTLR3_COMMON_TOKEN) MATCHT(NEWLINE, &FOLLOW_NEWLINE_in_equation_system157);
+ if (HASEXCEPTION())
+ {
+ goto ruleequation_systemEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ }
+ break;
+
+ default:
+ goto loop3; /* break out of the loop */
+ break;
+ }
+ }
+ loop3: ; /* Jump out to here if this rule does not match */
+
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleequation_systemEx; /* Prevent compiler warnings */
+ ruleequation_systemEx: ;
+ retval.stop = LT(-1);
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ retval.stop = LT(-1);
+
+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
+ }
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
+ }
+ return retval;
+}
+/* $ANTLR end equation_system */
+
+/**
+ * $ANTLR start equation
+ * EquationSystem.g:23:1: equation : VARIABLE '=' ! maxExpr ;
+ */
+static EquationSystemParser_equation_return
+equation(pEquationSystemParser ctx)
+{
+ EquationSystemParser_equation_return retval;
+
+
+ pANTLR3_BASE_TREE root_0;
+
+ pANTLR3_COMMON_TOKEN VARIABLE5;
+ pANTLR3_COMMON_TOKEN char_literal6;
+ EquationSystemParser_maxExpr_return maxExpr7;
+ #undef RETURN_TYPE_maxExpr7
+ #define RETURN_TYPE_maxExpr7 EquationSystemParser_maxExpr_return
+
+ pANTLR3_BASE_TREE VARIABLE5_tree;
+ pANTLR3_BASE_TREE char_literal6_tree;
+
+ /* Initialize rule variables
+ */
+
+ root_0 = NULL;
+
+ VARIABLE5 = NULL;
+ char_literal6 = NULL;
+ maxExpr7.tree = NULL;
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ VARIABLE5_tree = NULL;
+ char_literal6_tree = NULL;
+
+
+ retval.tree = NULL;
+
+ {
+ // EquationSystem.g:23:10: ( VARIABLE '=' ! maxExpr )
+ // EquationSystem.g:23:12: VARIABLE '=' ! maxExpr
+ {
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
+
+
+ VARIABLE5 = (pANTLR3_COMMON_TOKEN) MATCHT(VARIABLE, &FOLLOW_VARIABLE_in_equation168);
+ if (HASEXCEPTION())
+ {
+ goto ruleequationEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) {
+ VARIABLE5_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, VARIABLE5));
+ ADAPTOR->addChild(ADAPTOR, root_0, VARIABLE5_tree);
+ }
+
+ char_literal6 = (pANTLR3_COMMON_TOKEN) MATCHT(22, &FOLLOW_22_in_equation170);
+ if (HASEXCEPTION())
+ {
+ goto ruleequationEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_maxExpr_in_equation173);
+ maxExpr7=maxExpr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleequationEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, maxExpr7.tree);
+
+ }
+
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleequationEx; /* Prevent compiler warnings */
+ ruleequationEx: ;
+ retval.stop = LT(-1);
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ retval.stop = LT(-1);
+
+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
+ }
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
+ }
+ return retval;
+}
+/* $ANTLR end equation */
+
+/**
+ * $ANTLR start maxExpr
+ * EquationSystem.g:25:1: maxExpr : ( MAXIMUM ^ '(' ! minExpr ( ',' ! minExpr )* ')' !| minExpr );
+ */
+static EquationSystemParser_maxExpr_return
+maxExpr(pEquationSystemParser ctx)
+{
+ EquationSystemParser_maxExpr_return retval;
+
+
+ pANTLR3_BASE_TREE root_0;
+
+ pANTLR3_COMMON_TOKEN MAXIMUM8;
+ pANTLR3_COMMON_TOKEN char_literal9;
+ pANTLR3_COMMON_TOKEN char_literal11;
+ pANTLR3_COMMON_TOKEN char_literal13;
+ EquationSystemParser_minExpr_return minExpr10;
+ #undef RETURN_TYPE_minExpr10
+ #define RETURN_TYPE_minExpr10 EquationSystemParser_minExpr_return
+
+ EquationSystemParser_minExpr_return minExpr12;
+ #undef RETURN_TYPE_minExpr12
+ #define RETURN_TYPE_minExpr12 EquationSystemParser_minExpr_return
+
+ EquationSystemParser_minExpr_return minExpr14;
+ #undef RETURN_TYPE_minExpr14
+ #define RETURN_TYPE_minExpr14 EquationSystemParser_minExpr_return
+
+ pANTLR3_BASE_TREE MAXIMUM8_tree;
+ pANTLR3_BASE_TREE char_literal9_tree;
+ pANTLR3_BASE_TREE char_literal11_tree;
+ pANTLR3_BASE_TREE char_literal13_tree;
+
+ /* Initialize rule variables
+ */
+
+ root_0 = NULL;
+
+ MAXIMUM8 = NULL;
+ char_literal9 = NULL;
+ char_literal11 = NULL;
+ char_literal13 = NULL;
+ minExpr10.tree = NULL;
+
+ minExpr12.tree = NULL;
+
+ minExpr14.tree = NULL;
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ MAXIMUM8_tree = NULL;
+ char_literal9_tree = NULL;
+ char_literal11_tree = NULL;
+ char_literal13_tree = NULL;
+
+
+ retval.tree = NULL;
+
+ {
+ {
+ // EquationSystem.g:25:9: ( MAXIMUM ^ '(' ! minExpr ( ',' ! minExpr )* ')' !| minExpr )
+
+ ANTLR3_UINT32 alt5;
+
+ alt5=2;
+
+ switch ( LA(1) )
+ {
+ case MAXIMUM:
+ {
+ alt5=1;
+ }
+ break;
+ case MINIMUM:
+ case NUMBER:
+ case SUB:
+ case VARIABLE:
+ case 19:
+ {
+ alt5=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 5;
+ EXCEPTION->state = 0;
+
+
+ goto rulemaxExprEx;
+
+ }
+
+ switch (alt5)
+ {
+ case 1:
+ // EquationSystem.g:25:11: MAXIMUM ^ '(' ! minExpr ( ',' ! minExpr )* ')' !
+ {
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
+
+
+ MAXIMUM8 = (pANTLR3_COMMON_TOKEN) MATCHT(MAXIMUM, &FOLLOW_MAXIMUM_in_maxExpr182);
+ if (HASEXCEPTION())
+ {
+ goto rulemaxExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) {
+ MAXIMUM8_tree =
+ (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, MAXIMUM8))
+ ;
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, MAXIMUM8_tree, root_0));
+ }
+
+ char_literal9 = (pANTLR3_COMMON_TOKEN) MATCHT(19, &FOLLOW_19_in_maxExpr185);
+ if (HASEXCEPTION())
+ {
+ goto rulemaxExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_minExpr_in_maxExpr188);
+ minExpr10=minExpr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemaxExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, minExpr10.tree);
+
+ // EquationSystem.g:25:33: ( ',' ! minExpr )*
+
+ for (;;)
+ {
+ int alt4=2;
+ switch ( LA(1) )
+ {
+ case 21:
+ {
+ alt4=1;
+ }
+ break;
+
+ }
+
+ switch (alt4)
+ {
+ case 1:
+ // EquationSystem.g:25:35: ',' ! minExpr
+ {
+ char_literal11 = (pANTLR3_COMMON_TOKEN) MATCHT(21, &FOLLOW_21_in_maxExpr192);
+ if (HASEXCEPTION())
+ {
+ goto rulemaxExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_minExpr_in_maxExpr195);
+ minExpr12=minExpr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemaxExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, minExpr12.tree);
+
+ }
+ break;
+
+ default:
+ goto loop4; /* break out of the loop */
+ break;
+ }
+ }
+ loop4: ; /* Jump out to here if this rule does not match */
+
+
+ char_literal13 = (pANTLR3_COMMON_TOKEN) MATCHT(20, &FOLLOW_20_in_maxExpr200);
+ if (HASEXCEPTION())
+ {
+ goto rulemaxExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ }
+ break;
+ case 2:
+ // EquationSystem.g:25:58: minExpr
+ {
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
+
+
+ FOLLOWPUSH(FOLLOW_minExpr_in_maxExpr205);
+ minExpr14=minExpr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulemaxExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, minExpr14.tree);
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto rulemaxExprEx; /* Prevent compiler warnings */
+ rulemaxExprEx: ;
+ retval.stop = LT(-1);
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ retval.stop = LT(-1);
+
+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
+ }
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
+ }
+ return retval;
+}
+/* $ANTLR end maxExpr */
+
+/**
+ * $ANTLR start minExpr
+ * EquationSystem.g:26:1: minExpr : ( MINIMUM ^ '(' ! maxExpr ( ',' ! maxExpr )* ')' !| expr );
+ */
+static EquationSystemParser_minExpr_return
+minExpr(pEquationSystemParser ctx)
+{
+ EquationSystemParser_minExpr_return retval;
+
+
+ pANTLR3_BASE_TREE root_0;
+
+ pANTLR3_COMMON_TOKEN MINIMUM15;
+ pANTLR3_COMMON_TOKEN char_literal16;
+ pANTLR3_COMMON_TOKEN char_literal18;
+ pANTLR3_COMMON_TOKEN char_literal20;
+ EquationSystemParser_maxExpr_return maxExpr17;
+ #undef RETURN_TYPE_maxExpr17
+ #define RETURN_TYPE_maxExpr17 EquationSystemParser_maxExpr_return
+
+ EquationSystemParser_maxExpr_return maxExpr19;
+ #undef RETURN_TYPE_maxExpr19
+ #define RETURN_TYPE_maxExpr19 EquationSystemParser_maxExpr_return
+
+ EquationSystemParser_expr_return expr21;
+ #undef RETURN_TYPE_expr21
+ #define RETURN_TYPE_expr21 EquationSystemParser_expr_return
+
+ pANTLR3_BASE_TREE MINIMUM15_tree;
+ pANTLR3_BASE_TREE char_literal16_tree;
+ pANTLR3_BASE_TREE char_literal18_tree;
+ pANTLR3_BASE_TREE char_literal20_tree;
+
+ /* Initialize rule variables
+ */
+
+ root_0 = NULL;
+
+ MINIMUM15 = NULL;
+ char_literal16 = NULL;
+ char_literal18 = NULL;
+ char_literal20 = NULL;
+ maxExpr17.tree = NULL;
+
+ maxExpr19.tree = NULL;
+
+ expr21.tree = NULL;
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ MINIMUM15_tree = NULL;
+ char_literal16_tree = NULL;
+ char_literal18_tree = NULL;
+ char_literal20_tree = NULL;
+
+
+ retval.tree = NULL;
+
+ {
+ {
+ // EquationSystem.g:26:9: ( MINIMUM ^ '(' ! maxExpr ( ',' ! maxExpr )* ')' !| expr )
+
+ ANTLR3_UINT32 alt7;
+
+ alt7=2;
+
+ switch ( LA(1) )
+ {
+ case MINIMUM:
+ {
+ alt7=1;
+ }
+ break;
+ case NUMBER:
+ case SUB:
+ case VARIABLE:
+ case 19:
+ {
+ alt7=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 7;
+ EXCEPTION->state = 0;
+
+
+ goto ruleminExprEx;
+
+ }
+
+ switch (alt7)
+ {
+ case 1:
+ // EquationSystem.g:26:11: MINIMUM ^ '(' ! maxExpr ( ',' ! maxExpr )* ')' !
+ {
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
+
+
+ MINIMUM15 = (pANTLR3_COMMON_TOKEN) MATCHT(MINIMUM, &FOLLOW_MINIMUM_in_minExpr213);
+ if (HASEXCEPTION())
+ {
+ goto ruleminExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) {
+ MINIMUM15_tree =
+ (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, MINIMUM15))
+ ;
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, MINIMUM15_tree, root_0));
+ }
+
+ char_literal16 = (pANTLR3_COMMON_TOKEN) MATCHT(19, &FOLLOW_19_in_minExpr216);
+ if (HASEXCEPTION())
+ {
+ goto ruleminExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_maxExpr_in_minExpr219);
+ maxExpr17=maxExpr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleminExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, maxExpr17.tree);
+
+ // EquationSystem.g:26:33: ( ',' ! maxExpr )*
+
+ for (;;)
+ {
+ int alt6=2;
+ switch ( LA(1) )
+ {
+ case 21:
+ {
+ alt6=1;
+ }
+ break;
+
+ }
+
+ switch (alt6)
+ {
+ case 1:
+ // EquationSystem.g:26:35: ',' ! maxExpr
+ {
+ char_literal18 = (pANTLR3_COMMON_TOKEN) MATCHT(21, &FOLLOW_21_in_minExpr223);
+ if (HASEXCEPTION())
+ {
+ goto ruleminExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_maxExpr_in_minExpr226);
+ maxExpr19=maxExpr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleminExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, maxExpr19.tree);
+
+ }
+ break;
+
+ default:
+ goto loop6; /* break out of the loop */
+ break;
+ }
+ }
+ loop6: ; /* Jump out to here if this rule does not match */
+
+
+ char_literal20 = (pANTLR3_COMMON_TOKEN) MATCHT(20, &FOLLOW_20_in_minExpr231);
+ if (HASEXCEPTION())
+ {
+ goto ruleminExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ }
+ break;
+ case 2:
+ // EquationSystem.g:26:58: expr
+ {
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
+
+
+ FOLLOWPUSH(FOLLOW_expr_in_minExpr236);
+ expr21=expr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleminExprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, expr21.tree);
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleminExprEx; /* Prevent compiler warnings */
+ ruleminExprEx: ;
+ retval.stop = LT(-1);
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ retval.stop = LT(-1);
+
+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
+ }
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
+ }
+ return retval;
+}
+/* $ANTLR end minExpr */
+
+/**
+ * $ANTLR start expr
+ * EquationSystem.g:28:1: expr : ( '(' expr GREATER_EQUAL expr QUESTION_MARK expr ')' -> ^( GUARD expr expr expr ) | term ( ( PLUS | MULT | SUB | COMMA ) ^ expr )* );
+ */
+static EquationSystemParser_expr_return
+expr(pEquationSystemParser ctx)
+{
+ EquationSystemParser_expr_return retval;
+
+
+ pANTLR3_BASE_TREE root_0;
+
+ pANTLR3_COMMON_TOKEN char_literal22;
+ pANTLR3_COMMON_TOKEN GREATER_EQUAL24;
+ pANTLR3_COMMON_TOKEN QUESTION_MARK26;
+ pANTLR3_COMMON_TOKEN char_literal28;
+ pANTLR3_COMMON_TOKEN set30;
+ EquationSystemParser_expr_return expr23;
+ #undef RETURN_TYPE_expr23
+ #define RETURN_TYPE_expr23 EquationSystemParser_expr_return
+
+ EquationSystemParser_expr_return expr25;
+ #undef RETURN_TYPE_expr25
+ #define RETURN_TYPE_expr25 EquationSystemParser_expr_return
+
+ EquationSystemParser_expr_return expr27;
+ #undef RETURN_TYPE_expr27
+ #define RETURN_TYPE_expr27 EquationSystemParser_expr_return
+
+ EquationSystemParser_term_return term29;
+ #undef RETURN_TYPE_term29
+ #define RETURN_TYPE_term29 EquationSystemParser_term_return
+
+ EquationSystemParser_expr_return expr31;
+ #undef RETURN_TYPE_expr31
+ #define RETURN_TYPE_expr31 EquationSystemParser_expr_return
+
+ pANTLR3_BASE_TREE char_literal22_tree;
+ pANTLR3_BASE_TREE GREATER_EQUAL24_tree;
+ pANTLR3_BASE_TREE QUESTION_MARK26_tree;
+ pANTLR3_BASE_TREE char_literal28_tree;
+ pANTLR3_BASE_TREE set30_tree;
+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_20;
+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_19;
+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_GREATER_EQUAL;
+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_QUESTION_MARK;
+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expr;
+ /* Initialize rule variables
+ */
+
+ root_0 = NULL;
+
+ char_literal22 = NULL;
+ GREATER_EQUAL24 = NULL;
+ QUESTION_MARK26 = NULL;
+ char_literal28 = NULL;
+ set30 = NULL;
+ expr23.tree = NULL;
+
+ expr25.tree = NULL;
+
+ expr27.tree = NULL;
+
+ term29.tree = NULL;
+
+ expr31.tree = NULL;
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ char_literal22_tree = NULL;
+ GREATER_EQUAL24_tree = NULL;
+ QUESTION_MARK26_tree = NULL;
+ char_literal28_tree = NULL;
+ set30_tree = NULL;
+
+ stream_20 = NULL;
+ #define CREATE_stream_20 if (stream_20 == NULL) {stream_20 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 20"); }
+ stream_19 = NULL;
+ #define CREATE_stream_19 if (stream_19 == NULL) {stream_19 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 19"); }
+ stream_GREATER_EQUAL = NULL;
+ #define CREATE_stream_GREATER_EQUAL if (stream_GREATER_EQUAL == NULL) {stream_GREATER_EQUAL = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token GREATER_EQUAL"); }
+ stream_QUESTION_MARK = NULL;
+ #define CREATE_stream_QUESTION_MARK if (stream_QUESTION_MARK == NULL) {stream_QUESTION_MARK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token QUESTION_MARK"); }
+ stream_expr = NULL;
+ #define CREATE_stream_expr if (stream_expr == NULL) {stream_expr = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expr"); }
+
+ retval.tree = NULL;
+
+ {
+ {
+ // EquationSystem.g:28:6: ( '(' expr GREATER_EQUAL expr QUESTION_MARK expr ')' -> ^( GUARD expr expr expr ) | term ( ( PLUS | MULT | SUB | COMMA ) ^ expr )* )
+
+ ANTLR3_UINT32 alt9;
+
+ alt9=2;
+
+ switch ( LA(1) )
+ {
+ case 19:
+ {
+ {
+ int LA9_1 = LA(2);
+ if ( (synpred8_EquationSystem(ctx)))
+ {
+ alt9=1;
+ }
+ else if ( (ANTLR3_TRUE))
+ {
+ alt9=2;
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 9;
+ EXCEPTION->state = 1;
+
+
+ goto ruleexprEx;
+
+ }
+ }
+ }
+ break;
+ case NUMBER:
+ case SUB:
+ case VARIABLE:
+ {
+ alt9=2;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 9;
+ EXCEPTION->state = 0;
+
+
+ goto ruleexprEx;
+
+ }
+
+ switch (alt9)
+ {
+ case 1:
+ // EquationSystem.g:28:8: '(' expr GREATER_EQUAL expr QUESTION_MARK expr ')'
+ {
+ char_literal22 = (pANTLR3_COMMON_TOKEN) MATCHT(19, &FOLLOW_19_in_expr245);
+ if (HASEXCEPTION())
+ {
+ goto ruleexprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) { CREATE_stream_19; stream_19->add(stream_19, char_literal22, NULL); }
+
+
+ FOLLOWPUSH(FOLLOW_expr_in_expr247);
+ expr23=expr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) { CREATE_stream_expr; stream_expr->add(stream_expr, expr23.tree, NULL); }
+
+ GREATER_EQUAL24 = (pANTLR3_COMMON_TOKEN) MATCHT(GREATER_EQUAL, &FOLLOW_GREATER_EQUAL_in_expr249);
+ if (HASEXCEPTION())
+ {
+ goto ruleexprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) { CREATE_stream_GREATER_EQUAL; stream_GREATER_EQUAL->add(stream_GREATER_EQUAL, GREATER_EQUAL24, NULL); }
+
+
+ FOLLOWPUSH(FOLLOW_expr_in_expr251);
+ expr25=expr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) { CREATE_stream_expr; stream_expr->add(stream_expr, expr25.tree, NULL); }
+
+ QUESTION_MARK26 = (pANTLR3_COMMON_TOKEN) MATCHT(QUESTION_MARK, &FOLLOW_QUESTION_MARK_in_expr253);
+ if (HASEXCEPTION())
+ {
+ goto ruleexprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) { CREATE_stream_QUESTION_MARK; stream_QUESTION_MARK->add(stream_QUESTION_MARK, QUESTION_MARK26, NULL); }
+
+
+ FOLLOWPUSH(FOLLOW_expr_in_expr255);
+ expr27=expr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) { CREATE_stream_expr; stream_expr->add(stream_expr, expr27.tree, NULL); }
+
+ char_literal28 = (pANTLR3_COMMON_TOKEN) MATCHT(20, &FOLLOW_20_in_expr257);
+ if (HASEXCEPTION())
+ {
+ goto ruleexprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) { CREATE_stream_20; stream_20->add(stream_20, char_literal28, NULL); }
+
+
+ /* AST REWRITE
+ * elements : expr, expr, expr
+ * token labels :
+ * rule labels : retval
+ * token list labels :
+ * rule list labels :
+ */
+ if ( BACKTRACKING==0 )
+
+ {
+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
+
+ stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
+
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
+ retval.tree = root_0;
+ // 28:59: -> ^( GUARD expr expr expr )
+ {
+ // EquationSystem.g:28:62: ^( GUARD expr expr expr )
+ {
+ pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
+ root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR,
+ (pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, GUARD, (pANTLR3_UINT8)"GUARD")
+ , root_1));
+
+ ADAPTOR->addChild(ADAPTOR, root_1, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
+
+ ADAPTOR->addChild(ADAPTOR, root_1, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
+
+ ADAPTOR->addChild(ADAPTOR, root_1, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
+
+ ADAPTOR->addChild(ADAPTOR, root_0, root_1);
+ }
+
+ }
+
+
+ retval.tree = root_0; // set result root
+ if (stream_retval != NULL) stream_retval->free(stream_retval);
+
+
+ }
+ }
+ break;
+ case 2:
+ // EquationSystem.g:29:8: term ( ( PLUS | MULT | SUB | COMMA ) ^ expr )*
+ {
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
+
+
+ FOLLOWPUSH(FOLLOW_term_in_expr278);
+ term29=term(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, term29.tree);
+
+ // EquationSystem.g:29:13: ( ( PLUS | MULT | SUB | COMMA ) ^ expr )*
+
+ for (;;)
+ {
+ int alt8=2;
+ switch ( LA(1) )
+ {
+ case COMMA:
+ case MULT:
+ case PLUS:
+ case SUB:
+ {
+ {
+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
+ */
+ int LA8_2 = LA(2);
+ if ( (synpred12_EquationSystem(ctx)))
+ {
+ alt8=1;
+ }
+
+ }
+ }
+ break;
+
+ }
+
+ switch (alt8)
+ {
+ case 1:
+ // EquationSystem.g:29:15: ( PLUS | MULT | SUB | COMMA ) ^ expr
+ {
+ set30=(pANTLR3_COMMON_TOKEN)LT(1);
+
+ set30=(pANTLR3_COMMON_TOKEN)LT(1);
+
+ if ( LA(1) == COMMA || LA(1) == MULT || LA(1) == PLUS || LA(1) == SUB )
+ {
+ CONSUME();
+ if ( BACKTRACKING==0 ) root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR,
+ (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set30))
+ , root_0));
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto ruleexprEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expr_in_expr299);
+ expr31=expr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruleexprEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, expr31.tree);
+
+ }
+ break;
+
+ default:
+ goto loop8; /* break out of the loop */
+ break;
+ }
+ }
+ loop8: ; /* Jump out to here if this rule does not match */
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruleexprEx; /* Prevent compiler warnings */
+ ruleexprEx: ;
+ retval.stop = LT(-1);
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ retval.stop = LT(-1);
+
+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
+ if (stream_20 != NULL) stream_20->free(stream_20);
+ if (stream_19 != NULL) stream_19->free(stream_19);
+ if (stream_GREATER_EQUAL != NULL) stream_GREATER_EQUAL->free(stream_GREATER_EQUAL);
+ if (stream_QUESTION_MARK != NULL) stream_QUESTION_MARK->free(stream_QUESTION_MARK);
+ if (stream_expr != NULL) stream_expr->free(stream_expr);
+ }
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
+ }
+ return retval;
+}
+/* $ANTLR end expr */
+
+/**
+ * $ANTLR start term
+ * EquationSystem.g:31:1: term : ( NUMBER | VARIABLE | '-' ^ term | '(' ! expr ')' !);
+ */
+static EquationSystemParser_term_return
+term(pEquationSystemParser ctx)
+{
+ EquationSystemParser_term_return retval;
+
+
+ pANTLR3_BASE_TREE root_0;
+
+ pANTLR3_COMMON_TOKEN NUMBER32;
+ pANTLR3_COMMON_TOKEN VARIABLE33;
+ pANTLR3_COMMON_TOKEN char_literal34;
+ pANTLR3_COMMON_TOKEN char_literal36;
+ pANTLR3_COMMON_TOKEN char_literal38;
+ EquationSystemParser_term_return term35;
+ #undef RETURN_TYPE_term35
+ #define RETURN_TYPE_term35 EquationSystemParser_term_return
+
+ EquationSystemParser_expr_return expr37;
+ #undef RETURN_TYPE_expr37
+ #define RETURN_TYPE_expr37 EquationSystemParser_expr_return
+
+ pANTLR3_BASE_TREE NUMBER32_tree;
+ pANTLR3_BASE_TREE VARIABLE33_tree;
+ pANTLR3_BASE_TREE char_literal34_tree;
+ pANTLR3_BASE_TREE char_literal36_tree;
+ pANTLR3_BASE_TREE char_literal38_tree;
+
+ /* Initialize rule variables
+ */
+
+ root_0 = NULL;
+
+ NUMBER32 = NULL;
+ VARIABLE33 = NULL;
+ char_literal34 = NULL;
+ char_literal36 = NULL;
+ char_literal38 = NULL;
+ term35.tree = NULL;
+
+ expr37.tree = NULL;
+ retval.start = LT(1); retval.stop = retval.start;
+
+
+ NUMBER32_tree = NULL;
+ VARIABLE33_tree = NULL;
+ char_literal34_tree = NULL;
+ char_literal36_tree = NULL;
+ char_literal38_tree = NULL;
+
+
+ retval.tree = NULL;
+
+ {
+ {
+ // EquationSystem.g:31:6: ( NUMBER | VARIABLE | '-' ^ term | '(' ! expr ')' !)
+
+ ANTLR3_UINT32 alt10;
+
+ alt10=4;
+
+ switch ( LA(1) )
+ {
+ case NUMBER:
+ {
+ alt10=1;
+ }
+ break;
+ case VARIABLE:
+ {
+ alt10=2;
+ }
+ break;
+ case SUB:
+ {
+ alt10=3;
+ }
+ break;
+ case 19:
+ {
+ alt10=4;
+ }
+ break;
+
+ default:
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return retval;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
+ EXCEPTION->message = (void *)"";
+ EXCEPTION->decisionNum = 10;
+ EXCEPTION->state = 0;
+
+
+ goto ruletermEx;
+
+ }
+
+ switch (alt10)
+ {
+ case 1:
+ // EquationSystem.g:31:8: NUMBER
+ {
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
+
+
+ NUMBER32 = (pANTLR3_COMMON_TOKEN) MATCHT(NUMBER, &FOLLOW_NUMBER_in_term311);
+ if (HASEXCEPTION())
+ {
+ goto ruletermEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) {
+ NUMBER32_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, NUMBER32));
+ ADAPTOR->addChild(ADAPTOR, root_0, NUMBER32_tree);
+ }
+
+ }
+ break;
+ case 2:
+ // EquationSystem.g:32:8: VARIABLE
+ {
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
+
+
+ VARIABLE33 = (pANTLR3_COMMON_TOKEN) MATCHT(VARIABLE, &FOLLOW_VARIABLE_in_term320);
+ if (HASEXCEPTION())
+ {
+ goto ruletermEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) {
+ VARIABLE33_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, VARIABLE33));
+ ADAPTOR->addChild(ADAPTOR, root_0, VARIABLE33_tree);
+ }
+
+ }
+ break;
+ case 3:
+ // EquationSystem.g:33:8: '-' ^ term
+ {
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
+
+
+ char_literal34 = (pANTLR3_COMMON_TOKEN) MATCHT(SUB, &FOLLOW_SUB_in_term329);
+ if (HASEXCEPTION())
+ {
+ goto ruletermEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) {
+ char_literal34_tree =
+ (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, char_literal34))
+ ;
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, char_literal34_tree, root_0));
+ }
+
+ FOLLOWPUSH(FOLLOW_term_in_term332);
+ term35=term(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletermEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, term35.tree);
+
+ }
+ break;
+ case 4:
+ // EquationSystem.g:34:8: '(' ! expr ')' !
+ {
+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
+
+
+ char_literal36 = (pANTLR3_COMMON_TOKEN) MATCHT(19, &FOLLOW_19_in_term341);
+ if (HASEXCEPTION())
+ {
+ goto ruletermEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expr_in_term344);
+ expr37=expr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto ruletermEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+ if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, expr37.tree);
+
+ char_literal38 = (pANTLR3_COMMON_TOKEN) MATCHT(20, &FOLLOW_20_in_term346);
+ if (HASEXCEPTION())
+ {
+ goto ruletermEx;
+ }
+ if (HASFAILED())
+ {
+ return retval;
+ }
+
+
+ }
+ break;
+
+ }
+ }
+ }
+
+ // This is where rules clean up and exit
+ //
+ goto ruletermEx; /* Prevent compiler warnings */
+ ruletermEx: ;
+ retval.stop = LT(-1);
+
+
+ if ( BACKTRACKING==0 )
+ {
+
+ retval.stop = LT(-1);
+
+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
+ }
+
+
+ if (HASEXCEPTION())
+ {
+ PREPORTERROR();
+ PRECOVER();
+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
+ }
+ return retval;
+}
+/* $ANTLR end term */
+
+// $ANTLR start synpred8_EquationSystem
+static void synpred8_EquationSystem_fragment(pEquationSystemParser ctx )
+{
+ // EquationSystem.g:28:8: ( '(' expr GREATER_EQUAL expr QUESTION_MARK expr ')' )
+ // EquationSystem.g:28:8: '(' expr GREATER_EQUAL expr QUESTION_MARK expr ')'
+ {
+ MATCHT(19, &FOLLOW_19_in_synpred8_EquationSystem245);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred8_EquationSystemEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expr_in_synpred8_EquationSystem247);
+ expr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred8_EquationSystemEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(GREATER_EQUAL, &FOLLOW_GREATER_EQUAL_in_synpred8_EquationSystem249);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred8_EquationSystemEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expr_in_synpred8_EquationSystem251);
+ expr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred8_EquationSystemEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(QUESTION_MARK, &FOLLOW_QUESTION_MARK_in_synpred8_EquationSystem253);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred8_EquationSystemEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expr_in_synpred8_EquationSystem255);
+ expr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred8_EquationSystemEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ MATCHT(20, &FOLLOW_20_in_synpred8_EquationSystem257);
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred8_EquationSystemEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred8_EquationSystemEx; /* Prevent compiler warnings */
+rulesynpred8_EquationSystemEx: ;
+
+}
+// $ANTLR end synpred8_EquationSystem
+
+// $ANTLR start synpred12_EquationSystem
+static void synpred12_EquationSystem_fragment(pEquationSystemParser ctx )
+{
+ // EquationSystem.g:29:15: ( ( PLUS | MULT | SUB | COMMA ) expr )
+ // EquationSystem.g:29:15: ( PLUS | MULT | SUB | COMMA ) expr
+ {
+ if ( LA(1) == COMMA || LA(1) == MULT || LA(1) == PLUS || LA(1) == SUB )
+ {
+ CONSUME();
+ PERRORRECOVERY=ANTLR3_FALSE;
+ FAILEDFLAG=ANTLR3_FALSE;
+
+ }
+ else
+ {
+ if (BACKTRACKING>0)
+ {
+ FAILEDFLAG = ANTLR3_TRUE;
+ return ;
+ }
+
+ CONSTRUCTEX();
+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
+ EXCEPTION->expectingSet = NULL;
+
+ goto rulesynpred12_EquationSystemEx;
+ }
+
+
+ FOLLOWPUSH(FOLLOW_expr_in_synpred12_EquationSystem299);
+ expr(ctx);
+
+ FOLLOWPOP();
+ if (HASEXCEPTION())
+ {
+ goto rulesynpred12_EquationSystemEx;
+ }
+ if (HASFAILED())
+ {
+ return ;
+ }
+
+
+ }
+
+// This is where rules clean up and exit
+//
+goto rulesynpred12_EquationSystemEx; /* Prevent compiler warnings */
+rulesynpred12_EquationSystemEx: ;
+
+}
+// $ANTLR end synpred12_EquationSystem
+/* End of parsing rules
+ * ==============================================
+ */
+
+/* ==============================================
+ * Syntactic predicates
+ */
+static ANTLR3_BOOLEAN synpred12_EquationSystem(pEquationSystemParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred12_EquationSystem_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+static ANTLR3_BOOLEAN synpred8_EquationSystem(pEquationSystemParser ctx)
+{
+ ANTLR3_MARKER start;
+ ANTLR3_BOOLEAN success;
+
+ BACKTRACKING++;
+ start = MARK();
+ synpred8_EquationSystem_fragment(ctx); // can never throw exception
+ success = !(FAILEDFLAG);
+ REWIND(start);
+ BACKTRACKING--;
+ FAILEDFLAG = ANTLR3_FALSE;
+ return success;
+}
+
+/* End of syntactic predicates
+ * ==============================================
+ */
+
+
+
+
+
+
+/* End of code
+ * =============================================================================
+ */
diff --git a/impl/parser/EquationSystemParser.h b/impl/parser/EquationSystemParser.h
new file mode 100644
index 0000000..0f24f97
--- /dev/null
+++ b/impl/parser/EquationSystemParser.h
@@ -0,0 +1,324 @@
+/** \file
+ * This C header file was generated by $ANTLR version 3.4
+ *
+ * - From the grammar source file : EquationSystem.g
+ * - On : 2012-07-12 15:47:50
+ * - for the parser : EquationSystemParserParser
+ *
+ * Editing it, at least manually, is not wise.
+ *
+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
+ *
+ *
+ * The parser
+EquationSystemParser
+
+has the callable functions (rules) shown below,
+ * which will invoke the code for the associated rule in the source grammar
+ * assuming that the input stream is pointing to a token/text stream that could begin
+ * this rule.
+ *
+ * For instance if you call the first (topmost) rule in a parser grammar, you will
+ * get the results of a full parse, but calling a rule half way through the grammar will
+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
+ * in editors and so on.
+ *
+ * The parser entry points are called indirectly (by function pointer to function) via
+ * a parser context typedef pEquationSystemParser, which is returned from a call to EquationSystemParserNew().
+ *
+ * The methods in pEquationSystemParser are as follows:
+ *
+ * -
+ EquationSystemParser_equation_system_return
+ pEquationSystemParser->equation_system(pEquationSystemParser)
+ * -
+ EquationSystemParser_equation_return
+ pEquationSystemParser->equation(pEquationSystemParser)
+ * -
+ EquationSystemParser_maxExpr_return
+ pEquationSystemParser->maxExpr(pEquationSystemParser)
+ * -
+ EquationSystemParser_minExpr_return
+ pEquationSystemParser->minExpr(pEquationSystemParser)
+ * -
+ EquationSystemParser_expr_return
+ pEquationSystemParser->expr(pEquationSystemParser)
+ * -
+ EquationSystemParser_term_return
+ pEquationSystemParser->term(pEquationSystemParser)
+ *
+ *
+ *
+ * The return type for any particular rule is of course determined by the source
+ * grammar file.
+ */
+// [The "BSD license"]
+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
+// http://www.temporal-wave.com
+// http://www.linkedin.com/in/jimidle
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. The name of the author may not be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef _EquationSystemParser_H
+#define _EquationSystemParser_H
+/* =============================================================================
+ * Standard antlr3 C runtime definitions
+ */
+#include <antlr3.h>
+
+/* End of standard antlr 3 runtime definitions
+ * =============================================================================
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Forward declare the context typedef so that we can use it before it is
+// properly defined. Delegators and delegates (from import statements) are
+// interdependent and their context structures contain pointers to each other
+// C only allows such things to be declared if you pre-declare the typedef.
+//
+typedef struct EquationSystemParser_Ctx_struct EquationSystemParser, * pEquationSystemParser;
+
+
+
+#ifdef ANTLR3_WINDOWS
+// Disable: Unreferenced parameter, - Rules with parameters that are not used
+// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
+// initialized but unused variable - tree rewrite variables declared but not needed
+// Unreferenced local variable - lexer rule declares but does not always use _type
+// potentially unitialized variable used - retval always returned from a rule
+// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
+//
+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
+// this is a matter of orthogonality hence I disable that one.
+//
+#pragma warning( disable : 4100 )
+#pragma warning( disable : 4101 )
+#pragma warning( disable : 4127 )
+#pragma warning( disable : 4189 )
+#pragma warning( disable : 4505 )
+#pragma warning( disable : 4701 )
+#endif
+
+/* ========================
+ * BACKTRACKING IS ENABLED
+ * ========================
+ */
+
+typedef struct EquationSystemParser_equation_system_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ pANTLR3_BASE_TREE tree;
+
+}
+ EquationSystemParser_equation_system_return;
+
+
+
+typedef struct EquationSystemParser_equation_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ pANTLR3_BASE_TREE tree;
+
+}
+ EquationSystemParser_equation_return;
+
+
+
+typedef struct EquationSystemParser_maxExpr_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ pANTLR3_BASE_TREE tree;
+
+}
+ EquationSystemParser_maxExpr_return;
+
+
+
+typedef struct EquationSystemParser_minExpr_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ pANTLR3_BASE_TREE tree;
+
+}
+ EquationSystemParser_minExpr_return;
+
+
+
+typedef struct EquationSystemParser_expr_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ pANTLR3_BASE_TREE tree;
+
+}
+ EquationSystemParser_expr_return;
+
+
+
+typedef struct EquationSystemParser_term_return_struct
+{
+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
+ */
+ pANTLR3_COMMON_TOKEN start;
+ pANTLR3_COMMON_TOKEN stop;
+ pANTLR3_BASE_TREE tree;
+
+}
+ EquationSystemParser_term_return;
+
+
+
+
+/** Context tracking structure for
+EquationSystemParser
+
+ */
+struct EquationSystemParser_Ctx_struct
+{
+ /** Built in ANTLR3 context tracker contains all the generic elements
+ * required for context tracking.
+ */
+ pANTLR3_PARSER pParser;
+
+ EquationSystemParser_equation_system_return
+ (*equation_system) (struct EquationSystemParser_Ctx_struct * ctx);
+
+ EquationSystemParser_equation_return
+ (*equation) (struct EquationSystemParser_Ctx_struct * ctx);
+
+ EquationSystemParser_maxExpr_return
+ (*maxExpr) (struct EquationSystemParser_Ctx_struct * ctx);
+
+ EquationSystemParser_minExpr_return
+ (*minExpr) (struct EquationSystemParser_Ctx_struct * ctx);
+
+ EquationSystemParser_expr_return
+ (*expr) (struct EquationSystemParser_Ctx_struct * ctx);
+
+ EquationSystemParser_term_return
+ (*term) (struct EquationSystemParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred8_EquationSystem) (struct EquationSystemParser_Ctx_struct * ctx);
+
+ ANTLR3_BOOLEAN
+ (*synpred12_EquationSystem) (struct EquationSystemParser_Ctx_struct * ctx);
+ // Delegated rules
+
+ const char * (*getGrammarFileName)();
+ void (*reset) (struct EquationSystemParser_Ctx_struct * ctx);
+ void (*free) (struct EquationSystemParser_Ctx_struct * ctx);
+/* @headerFile.members() */
+pANTLR3_BASE_TREE_ADAPTOR adaptor;
+pANTLR3_VECTOR_FACTORY vectors;
+/* End @headerFile.members() */
+};
+
+// Function protoypes for the constructor functions that external translation units
+// such as delegators and delegates may wish to call.
+//
+ANTLR3_API pEquationSystemParser EquationSystemParserNew (
+pANTLR3_COMMON_TOKEN_STREAM
+ instream);
+ANTLR3_API pEquationSystemParser EquationSystemParserNewSSD (
+pANTLR3_COMMON_TOKEN_STREAM
+ instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
+
+/** Symbolic definitions of all the tokens that the
+parser
+ will work with.
+ * \{
+ *
+ * Antlr will define EOF, but we can't use that as it it is too common in
+ * in C header files and that would be confusing. There is no way to filter this out at the moment
+ * so we just undef it here for now. That isn't the value we get back from C recognizers
+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
+ */
+#ifdef EOF
+#undef EOF
+#endif
+#ifdef Tokens
+#undef Tokens
+#endif
+#define EOF -1
+#define T__19 19
+#define T__20 20
+#define T__21 21
+#define T__22 22
+#define COMMA 4
+#define DIGIT 5
+#define GREATER_EQUAL 6
+#define GUARD 7
+#define LETTER 8
+#define MAXIMUM 9
+#define MINIMUM 10
+#define MULT 11
+#define NEWLINE 12
+#define NUMBER 13
+#define PLUS 14
+#define QUESTION_MARK 15
+#define SUB 16
+#define VARIABLE 17
+#define WHITESPACE 18
+#ifdef EOF
+#undef EOF
+#define EOF ANTLR3_TOKEN_EOF
+#endif
+
+#ifndef TOKENSOURCE
+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
+#endif
+
+/* End of token definitions for EquationSystemParser
+ * =============================================================================
+ */
+/** } */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* END - Note:Keep extra line feed to satisfy UNIX systems */
diff --git a/impl/parser/EquationSystemParser.o b/impl/parser/EquationSystemParser.o
new file mode 100644
index 0000000..2dcfc81
--- /dev/null
+++ b/impl/parser/EquationSystemParser.o
Binary files differ