Logo Search packages:      
Sourcecode: kayali version File versions  Download package

MaximaLexer.py

### $ANTLR 2.7.6 (20060120): "maxima.g" -> "MaximaLexer.py"$
### import antlr and other modules ..
import sys
import antlr

version = sys.version.split()[0]
if version < '2.2.1':
    False = 0
if version < '2.3':
    True = not False
### header action >>> 
import nodesubclasses
### header action <<< 
### preamble action >>> 

### preamble action <<< 
### >>>The Literals<<<
literals = {}


### import antlr.Token 
from antlr import Token
### >>>The Known Token Types <<<
SKIP                = antlr.SKIP
INVALID_TYPE        = antlr.INVALID_TYPE
EOF_TYPE            = antlr.EOF_TYPE
EOF                 = antlr.EOF
NULL_TREE_LOOKAHEAD = antlr.NULL_TREE_LOOKAHEAD
MIN_USER_TYPE       = antlr.MIN_USER_TYPE
NOOP = 4
FOR = 5
IF = 6
THEN = 7
ELSE = 8
THRU = 9
WHILE = 10
UNLESS = 11
DO = 12
STEP = 13
IN = 14
LABEL = 15
COMMA = 16
ASSIGN = 17
ASSIGN2 = 18
MACRODEF = 19
FUNCDEF = 20
COMPARE = 21
OR = 22
AND = 23
NOT = 24
POWER = 25
POWER2 = 26
TIMES = 27
DIVIDE = 28
MINUS = 29
PLUS = 30
DOT = 31
EQUALS = 32
NOTEQUALS = 33
MATRIX = 34
NUM = 35
BRACKET = 36
SQBRACKET = 37
VAR = 38
INTEGRATE = 39
DIFFERENTIATE = 40
SUM = 41
SQRT = 42
NEG = 43
FACTORIAL = 44
FUNCTION = 45
LIMIT = 46
RPAREN = 47
WS = 48
DIGIT = 49
INT = 50
LOWER = 51
UPPER = 52
LETTER = 53
PERCENT = 54
SEMICOLON = 55

class Lexer(antlr.CharScanner) :
    ### user action >>>
    ### user action <<<
    def __init__(self, *argv, **kwargs) :
        antlr.CharScanner.__init__(self, *argv, **kwargs)
        self.caseSensitiveLiterals = False
        self.setCaseSensitive(False)
        self.literals = literals
    
    def nextToken(self):
        while True:
            try: ### try again ..
                while True:
                    _token = None
                    _ttype = INVALID_TYPE
                    self.resetText()
                    try: ## for char stream error handling
                        try: ##for lexical error handling
                            la1 = self.LA(1)
                            if False:
                                pass
                            elif la1 and la1 in u'\t\n\r ':
                                pass
                                self.mWS(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u'0123456789':
                                pass
                                self.mNUM(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u'.':
                                pass
                                self.mDOT(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u'<>':
                                pass
                                self.mCOMPARE(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u'(':
                                pass
                                self.mBRACKET(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u')]':
                                pass
                                self.mRPAREN(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u'[':
                                pass
                                self.mSQBRACKET(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u',':
                                pass
                                self.mCOMMA(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u'*':
                                pass
                                self.mTIMES(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u'/':
                                pass
                                self.mDIVIDE(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u'+':
                                pass
                                self.mPLUS(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u'-':
                                pass
                                self.mMINUS(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u';':
                                pass
                                self.mSEMICOLON(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u'=':
                                pass
                                self.mEQUALS(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u'#':
                                pass
                                self.mNOTEQUALS(True)
                                theRetToken = self._returnToken
                            elif la1 and la1 in u'!':
                                pass
                                self.mFACTORIAL(True)
                                theRetToken = self._returnToken
                            else:
                                if (self.LA(1)==u'u') and (self.LA(2)==u'n') and (self.LA(3)==u'l') and (self.LA(4)==u'e') and (self.LA(5)==u's') and (self.LA(6)==u's') and (_tokenSet_0.member(self.LA(7))):
                                    pass
                                    self.mUNLESS(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'm') and (self.LA(2)==u'a') and (self.LA(3)==u't') and (self.LA(4)==u'r') and (self.LA(5)==u'i') and (self.LA(6)==u'x') and (True) and (True):
                                    pass
                                    self.mMATRIX(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'\'' or self.LA(1)==u'd' or self.LA(1)==u'i') and (self.LA(2)==u'e' or self.LA(2)==u'i' or self.LA(2)==u'n') and (self.LA(3)==u'f' or self.LA(3)==u'n' or self.LA(3)==u't') and (self.LA(4)==u'e' or self.LA(4)==u'i' or self.LA(4)==u't') and (self.LA(5)==u'e' or self.LA(5)==u'g' or self.LA(5)==u'n') and (self.LA(6)==u'g' or self.LA(6)==u'r' or self.LA(6)==u't') and (True) and (True):
                                    pass
                                    self.mINTEGRATE(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'w') and (self.LA(2)==u'h') and (self.LA(3)==u'i') and (self.LA(4)==u'l') and (self.LA(5)==u'e') and (_tokenSet_0.member(self.LA(6))):
                                    pass
                                    self.mWHILE(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'l') and (self.LA(2)==u'i') and (self.LA(3)==u'm') and (self.LA(4)==u'i') and (self.LA(5)==u't') and (True) and (True) and (True):
                                    pass
                                    self.mLIMIT(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u't') and (self.LA(2)==u'h') and (self.LA(3)==u'r') and (self.LA(4)==u'u') and (_tokenSet_0.member(self.LA(5))):
                                    pass
                                    self.mTHRU(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u's') and (self.LA(2)==u't') and (self.LA(3)==u'e') and (self.LA(4)==u'p') and (_tokenSet_0.member(self.LA(5))):
                                    pass
                                    self.mSTEP(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u't') and (self.LA(2)==u'h') and (self.LA(3)==u'e') and (self.LA(4)==u'n') and (_tokenSet_0.member(self.LA(5))):
                                    pass
                                    self.mTHEN(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'e') and (self.LA(2)==u'l') and (self.LA(3)==u's') and (self.LA(4)==u'e') and (_tokenSet_0.member(self.LA(5))):
                                    pass
                                    self.mELSE(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'a') and (self.LA(2)==u'n') and (self.LA(3)==u'd') and (_tokenSet_0.member(self.LA(4))):
                                    pass
                                    self.mAND(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'n') and (self.LA(2)==u'o') and (self.LA(3)==u't') and (_tokenSet_0.member(self.LA(4))):
                                    pass
                                    self.mNOT(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u's') and (self.LA(2)==u'q') and (self.LA(3)==u'r') and (self.LA(4)==u't') and (True) and (True) and (True) and (True):
                                    pass
                                    self.mSQRT(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'\'' or self.LA(1)==u'd') and (self.LA(2)==u'd' or self.LA(2)==u'i') and (self.LA(3)==u'f' or self.LA(3)==u'i') and (self.LA(4)==u'f') and (True) and (True) and (True) and (True):
                                    pass
                                    self.mDIFFERENTIATE(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'f') and (self.LA(2)==u'o') and (self.LA(3)==u'r') and (_tokenSet_0.member(self.LA(4))):
                                    pass
                                    self.mFOR(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u':') and (self.LA(2)==u':') and (self.LA(3)==u'='):
                                    pass
                                    self.mMACRODEF(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'o') and (self.LA(2)==u'r') and (_tokenSet_0.member(self.LA(3))):
                                    pass
                                    self.mOR(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'\'' or self.LA(1)==u's') and (self.LA(2)==u's' or self.LA(2)==u'u') and (self.LA(3)==u'm' or self.LA(3)==u'u') and (True) and (True) and (True) and (True) and (True):
                                    pass
                                    self.mSUM(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'i') and (self.LA(2)==u'n') and (_tokenSet_0.member(self.LA(3))):
                                    pass
                                    self.mIN(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'd') and (self.LA(2)==u'o') and (_tokenSet_0.member(self.LA(3))):
                                    pass
                                    self.mDO(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'i') and (self.LA(2)==u'f') and (_tokenSet_0.member(self.LA(3))):
                                    pass
                                    self.mIF(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u':') and (self.LA(2)==u':') and (True):
                                    pass
                                    self.mASSIGN2(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u':') and (self.LA(2)==u'='):
                                    pass
                                    self.mFUNCDEF(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'^') and (self.LA(2)==u'^'):
                                    pass
                                    self.mPOWER2(True)
                                    theRetToken = self._returnToken
                                elif (_tokenSet_1.member(self.LA(1))) and (True) and (True) and (True) and (True) and (True) and (True) and (True):
                                    pass
                                    self.mVAR(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u':') and (True):
                                    pass
                                    self.mASSIGN(True)
                                    theRetToken = self._returnToken
                                elif (self.LA(1)==u'^') and (True):
                                    pass
                                    self.mPOWER(True)
                                    theRetToken = self._returnToken
                                else:
                                    self.default(self.LA(1))
                                
                            if not self._returnToken:
                                raise antlr.TryAgain ### found SKIP token
                            ### option { testLiterals=true } 
                            self.testForLiteral(self._returnToken)
                            ### return token to caller
                            return self._returnToken
                        ### handle lexical errors ....
                        except antlr.RecognitionException, e:
                            raise antlr.TokenStreamRecognitionException(e)
                    ### handle char stream errors ...
                    except antlr.CharStreamException,cse:
                        if isinstance(cse, antlr.CharStreamIOException):
                            raise antlr.TokenStreamIOException(cse.io)
                        else:
                            raise antlr.TokenStreamException(str(cse))
            except antlr.TryAgain:
                pass
        
    def mWS(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = WS
        _saveIndex = 0
        pass
        la1 = self.LA(1)
        if False:
            pass
        elif la1 and la1 in u' ':
            pass
            self.match(' ')
        elif la1 and la1 in u'\t':
            pass
            self.match('\t')
        elif la1 and la1 in u'\n':
            pass
            self.match('\n')
            self.newline()
        else:
            if (self.LA(1)==u'\r') and (self.LA(2)==u'\n'):
                pass
                self.match("\r\n")
                self.newline()
            elif (self.LA(1)==u'\r') and (True):
                pass
                self.match('\r')
                self.newline()
            else:
                self.raise_NoViableAlt(self.LA(1))
            
        _ttype = SKIP
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mDIGIT(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = DIGIT
        _saveIndex = 0
        pass
        self.matchRange(u'0', u'9')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mINT(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = INT
        _saveIndex = 0
        pass
        _cnt65= 0
        while True:
            if ((self.LA(1) >= u'0' and self.LA(1) <= u'9')):
                pass
                self.mDIGIT(False)
            else:
                break
            
            _cnt65 += 1
        if _cnt65 < 1:
            self.raise_NoViableAlt(self.LA(1))
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mNUM(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = NUM
        _saveIndex = 0
        pass
        self.mINT(False)
        if (self.LA(1)==u'.'):
            pass
            self.mDOT(False)
            self.mINT(False)
        else: ## <m4>
                pass
            
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mDOT(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = DOT
        _saveIndex = 0
        pass
        self.match('.')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mLOWER(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = LOWER
        _saveIndex = 0
        pass
        self.matchRange(u'a', u'z')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mUPPER(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = UPPER
        _saveIndex = 0
        pass
        self.matchRange(u'A', u'Z')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mLETTER(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = LETTER
        _saveIndex = 0
        la1 = self.LA(1)
        if False:
            pass
        elif la1 and la1 in u'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
            pass
            self.mUPPER(False)
        elif la1 and la1 in u'abcdefghijklmnopqrstuvwxyz':
            pass
            self.mLOWER(False)
        else:
                self.raise_NoViableAlt(self.LA(1))
            
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mPERCENT(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = PERCENT
        _saveIndex = 0
        pass
        self.match('%')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mVAR(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = VAR
        _saveIndex = 0
        la1 = self.LA(1)
        if False:
            pass
        elif la1 and la1 in u'%':
            pass
            self.mPERCENT(False)
            self.mLETTER(False)
            while True:
                la1 = self.LA(1)
                if False:
                    pass
                elif la1 and la1 in u'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz':
                    pass
                    self.mLETTER(False)
                elif la1 and la1 in u'0123456789':
                    pass
                    self.mDIGIT(False)
                else:
                        break
                    
        elif la1 and la1 in u'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz':
            pass
            self.mLETTER(False)
            while True:
                la1 = self.LA(1)
                if False:
                    pass
                elif la1 and la1 in u'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz':
                    pass
                    self.mLETTER(False)
                elif la1 and la1 in u'0123456789':
                    pass
                    self.mDIGIT(False)
                else:
                        break
                    
        else:
                self.raise_NoViableAlt(self.LA(1))
            
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mASSIGN(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = ASSIGN
        _saveIndex = 0
        pass
        self.match(":")
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mASSIGN2(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = ASSIGN2
        _saveIndex = 0
        pass
        self.match("::")
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mMACRODEF(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = MACRODEF
        _saveIndex = 0
        pass
        self.match("::=")
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mFUNCDEF(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = FUNCDEF
        _saveIndex = 0
        pass
        self.match(":=")
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mAND(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = AND
        _saveIndex = 0
        pass
        self.match("and")
        _saveIndex = self.text.length()
        self.mWS(False)
        self.text.setLength(_saveIndex)
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mOR(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = OR
        _saveIndex = 0
        pass
        self.match("or")
        _saveIndex = self.text.length()
        self.mWS(False)
        self.text.setLength(_saveIndex)
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mNOT(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = NOT
        _saveIndex = 0
        pass
        self.match("not")
        _saveIndex = self.text.length()
        self.mWS(False)
        self.text.setLength(_saveIndex)
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mCOMPARE(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = COMPARE
        _saveIndex = 0
        if (self.LA(1)==u'>') and (self.LA(2)==u'='):
            pass
            self.match(">=")
        elif (self.LA(1)==u'<') and (self.LA(2)==u'='):
            pass
            self.match("<=")
        elif (self.LA(1)==u'>') and (True):
            pass
            self.match(">")
        elif (self.LA(1)==u'<') and (True):
            pass
            self.match("<")
        else:
            self.raise_NoViableAlt(self.LA(1))
        
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mBRACKET(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = BRACKET
        _saveIndex = 0
        pass
        self.match('(')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mRPAREN(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = RPAREN
        _saveIndex = 0
        la1 = self.LA(1)
        if False:
            pass
        elif la1 and la1 in u')':
            pass
            self.match(')')
        elif la1 and la1 in u']':
            pass
            self.match(']')
        else:
                self.raise_NoViableAlt(self.LA(1))
            
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mSQBRACKET(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = SQBRACKET
        _saveIndex = 0
        pass
        self.match('[')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mPOWER(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = POWER
        _saveIndex = 0
        pass
        self.match('^')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mPOWER2(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = POWER2
        _saveIndex = 0
        pass
        self.match("^^")
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mCOMMA(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = COMMA
        _saveIndex = 0
        pass
        self.match(',')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mTIMES(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = TIMES
        _saveIndex = 0
        pass
        self.match('*')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mDIVIDE(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = DIVIDE
        _saveIndex = 0
        pass
        self.match('/')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mPLUS(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = PLUS
        _saveIndex = 0
        pass
        self.match('+')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mMINUS(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = MINUS
        _saveIndex = 0
        pass
        self.match('-')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mSEMICOLON(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = SEMICOLON
        _saveIndex = 0
        pass
        self.match(';')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mEQUALS(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = EQUALS
        _saveIndex = 0
        pass
        self.match('=')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mNOTEQUALS(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = NOTEQUALS
        _saveIndex = 0
        pass
        self.match('#')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mFACTORIAL(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = FACTORIAL
        _saveIndex = 0
        pass
        self.match('!')
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mLIMIT(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = LIMIT
        _saveIndex = 0
        pass
        self.match("limit")
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mSQRT(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = SQRT
        _saveIndex = 0
        pass
        self.match("sqrt")
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mMATRIX(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = MATRIX
        _saveIndex = 0
        pass
        self.match("matrix")
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mINTEGRATE(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = INTEGRATE
        _saveIndex = 0
        la1 = self.LA(1)
        if False:
            pass
        elif la1 and la1 in u'i':
            pass
            self.match("integrate")
        elif la1 and la1 in u'\'':
            pass
            self.match("'integrate")
        elif la1 and la1 in u'd':
            pass
            self.match("defint")
        else:
                self.raise_NoViableAlt(self.LA(1))
            
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mDIFFERENTIATE(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = DIFFERENTIATE
        _saveIndex = 0
        la1 = self.LA(1)
        if False:
            pass
        elif la1 and la1 in u'd':
            pass
            self.match("diff")
        elif la1 and la1 in u'\'':
            pass
            self.match("'diff")
        else:
                self.raise_NoViableAlt(self.LA(1))
            
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mSUM(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = SUM
        _saveIndex = 0
        la1 = self.LA(1)
        if False:
            pass
        elif la1 and la1 in u's':
            pass
            self.match("sum")
        elif la1 and la1 in u'\'':
            pass
            self.match("'sum")
        else:
                self.raise_NoViableAlt(self.LA(1))
            
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mFOR(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = FOR
        _saveIndex = 0
        pass
        self.match("for")
        _saveIndex = self.text.length()
        self.mWS(False)
        self.text.setLength(_saveIndex)
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mIN(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = IN
        _saveIndex = 0
        pass
        self.match("in")
        _saveIndex = self.text.length()
        self.mWS(False)
        self.text.setLength(_saveIndex)
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mDO(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = DO
        _saveIndex = 0
        pass
        self.match("do")
        _saveIndex = self.text.length()
        self.mWS(False)
        self.text.setLength(_saveIndex)
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mTHRU(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = THRU
        _saveIndex = 0
        pass
        self.match("thru")
        _saveIndex = self.text.length()
        self.mWS(False)
        self.text.setLength(_saveIndex)
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mSTEP(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = STEP
        _saveIndex = 0
        pass
        self.match("step")
        _saveIndex = self.text.length()
        self.mWS(False)
        self.text.setLength(_saveIndex)
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mWHILE(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = WHILE
        _saveIndex = 0
        pass
        self.match("while")
        _saveIndex = self.text.length()
        self.mWS(False)
        self.text.setLength(_saveIndex)
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mUNLESS(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = UNLESS
        _saveIndex = 0
        pass
        self.match("unless")
        _saveIndex = self.text.length()
        self.mWS(False)
        self.text.setLength(_saveIndex)
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mIF(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = IF
        _saveIndex = 0
        pass
        self.match("if")
        _saveIndex = self.text.length()
        self.mWS(False)
        self.text.setLength(_saveIndex)
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mTHEN(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = THEN
        _saveIndex = 0
        pass
        self.match("then")
        _saveIndex = self.text.length()
        self.mWS(False)
        self.text.setLength(_saveIndex)
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    def mELSE(self, _createToken):    
        _ttype = 0
        _token = None
        _begin = self.text.length()
        _ttype = ELSE
        _saveIndex = 0
        pass
        self.match("else")
        _saveIndex = self.text.length()
        self.mWS(False)
        self.text.setLength(_saveIndex)
        self.set_return_token(_createToken, _token, _ttype, _begin)
    
    

### generate bit set
def mk_tokenSet_0(): 
    ### var1
    data = [ 4294977024L, 0L, 0L]
    return data
_tokenSet_0 = antlr.BitSet(mk_tokenSet_0())

### generate bit set
def mk_tokenSet_1(): 
    ### var1
    data = [ 137438953472L, 576460743847706622L, 0L, 0L]
    return data
_tokenSet_1 = antlr.BitSet(mk_tokenSet_1())
    
### __main__ header action >>> 
if __name__ == '__main__' :
    import sys
    import antlr
    import MaximaLexer
    
    ### create lexer - shall read from stdin
    try:
        for token in MaximaLexer.Lexer():
            print token
            
    except antlr.TokenStreamException, e:
        print "error: exception caught while lexing: ", e
### __main__ header action <<< 

Generated by  Doxygen 1.6.0   Back to index