# Generated from FullForm.g4 by ANTLR 4.7.2
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys

def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\33")
        buf.write("r\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b")
        buf.write("\t\b\4\t\t\t\3\2\3\2\6\2\25\n\2\r\2\16\2\26\3\2\5\2\32")
        buf.write("\n\2\7\2\34\n\2\f\2\16\2\37\13\2\3\3\3\3\3\3\3\3\5\3%")
        buf.write("\n\3\3\3\3\3\3\3\3\3\3\3\7\3,\n\3\f\3\16\3/\13\3\3\4\5")
        buf.write("\4\62\n\4\3\4\3\4\5\4\66\n\4\7\48\n\4\f\4\16\4;\13\4\3")
        buf.write("\5\5\5>\n\5\3\5\3\5\3\6\5\6C\n\6\3\6\3\6\3\6\3\6\3\6\3")
        buf.write("\6\5\6K\n\6\3\7\5\7N\n\7\3\7\3\7\3\7\5\7S\n\7\3\7\5\7")
        buf.write("V\n\7\3\7\5\7Y\n\7\3\7\3\7\5\7]\n\7\3\7\5\7`\n\7\5\7b")
        buf.write("\n\7\3\b\3\b\3\b\3\b\5\bh\n\b\5\bj\n\b\3\t\3\t\5\tn\n")
        buf.write("\t\3\t\3\t\3\t\2\3\4\n\2\4\6\b\n\f\16\20\2\4\4\2\4\4\6")
        buf.write("\6\3\2\b\t\2\177\2\22\3\2\2\2\4$\3\2\2\2\6\61\3\2\2\2")
        buf.write("\b=\3\2\2\2\nJ\3\2\2\2\fa\3\2\2\2\16i\3\2\2\2\20k\3\2")
        buf.write("\2\2\22\35\5\4\3\2\23\25\7\31\2\2\24\23\3\2\2\2\25\26")
        buf.write("\3\2\2\2\26\24\3\2\2\2\26\27\3\2\2\2\27\31\3\2\2\2\30")
        buf.write("\32\5\4\3\2\31\30\3\2\2\2\31\32\3\2\2\2\32\34\3\2\2\2")
        buf.write("\33\24\3\2\2\2\34\37\3\2\2\2\35\33\3\2\2\2\35\36\3\2\2")
        buf.write("\2\36\3\3\2\2\2\37\35\3\2\2\2 !\b\3\1\2!%\5\f\7\2\"%\7")
        buf.write("\7\2\2#%\5\b\5\2$ \3\2\2\2$\"\3\2\2\2$#\3\2\2\2%-\3\2")
        buf.write("\2\2&\'\f\3\2\2\'(\7\13\2\2()\5\6\4\2)*\7\f\2\2*,\3\2")
        buf.write("\2\2+&\3\2\2\2,/\3\2\2\2-+\3\2\2\2-.\3\2\2\2.\5\3\2\2")
        buf.write("\2/-\3\2\2\2\60\62\5\4\3\2\61\60\3\2\2\2\61\62\3\2\2\2")
        buf.write("\629\3\2\2\2\63\65\7\r\2\2\64\66\5\4\3\2\65\64\3\2\2\2")
        buf.write("\65\66\3\2\2\2\668\3\2\2\2\67\63\3\2\2\28;\3\2\2\29\67")
        buf.write("\3\2\2\29:\3\2\2\2:\7\3\2\2\2;9\3\2\2\2<>\5\n\6\2=<\3")
        buf.write("\2\2\2=>\3\2\2\2>?\3\2\2\2?@\7\3\2\2@\t\3\2\2\2AC\7\21")
        buf.write("\2\2BA\3\2\2\2BC\3\2\2\2CD\3\2\2\2DE\7\3\2\2EK\7\21\2")
        buf.write("\2FG\7\3\2\2GH\7\21\2\2HI\7\3\2\2IK\7\21\2\2JB\3\2\2\2")
        buf.write("JF\3\2\2\2K\13\3\2\2\2LN\7\t\2\2ML\3\2\2\2MN\3\2\2\2N")
        buf.write("O\3\2\2\2OP\7\6\2\2PR\7\5\2\2QS\5\16\b\2RQ\3\2\2\2RS\3")
        buf.write("\2\2\2SU\3\2\2\2TV\5\20\t\2UT\3\2\2\2UV\3\2\2\2Vb\3\2")
        buf.write("\2\2WY\7\t\2\2XW\3\2\2\2XY\3\2\2\2YZ\3\2\2\2Z\\\t\2\2")
        buf.write("\2[]\5\16\b\2\\[\3\2\2\2\\]\3\2\2\2]_\3\2\2\2^`\5\20\t")
        buf.write("\2_^\3\2\2\2_`\3\2\2\2`b\3\2\2\2aM\3\2\2\2aX\3\2\2\2b")
        buf.write("\r\3\2\2\2cd\7\20\2\2dj\t\2\2\2eg\7\21\2\2fh\t\2\2\2g")
        buf.write("f\3\2\2\2gh\3\2\2\2hj\3\2\2\2ic\3\2\2\2ie\3\2\2\2j\17")
        buf.write("\3\2\2\2km\7\27\2\2ln\t\3\2\2ml\3\2\2\2mn\3\2\2\2no\3")
        buf.write("\2\2\2op\7\6\2\2p\21\3\2\2\2\27\26\31\35$-\61\659=BJM")
        buf.write("RUX\\_agim")
        return buf.getvalue()


class FullFormParser ( Parser ):

    grammarFileName = "FullForm.g4"

    atn = ATNDeserializer().deserialize(serializedATN())

    decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "'+'", "'-'", "<INVALID>", 
                     "'['", "']'", "','", "'(*'", "'*)'", "'``'", "'`'", 
                     "'''", "'\"'", "':'", "'\\'", "'^^'", "'*^'", "'.'", 
                     "'\n'", "'\uF3B1'" ]

    symbolicNames = [ "<INVALID>", "Name", "DecimalNumber", "NumberInBase", 
                      "DIGITS", "StringLiteral", "PLUS", "MINUS", "COMMENT", 
                      "LBRACKET", "RBRACKET", "COMMA", "LCOMMENT", "RCOMMENT", 
                      "DOUBLEBACKQUOTE", "BACKQUOTE", "SINGLEQUOTE", "QUOTE", 
                      "RAWCOLON", "RAWBACKSLASH", "DOUBLECARET", "ASTERISKCARET", 
                      "DOT", "NEWLINE", "CONTINUATION", "WHITESPACE" ]

    RULE_prog = 0
    RULE_expr = 1
    RULE_expressionList = 2
    RULE_symbol = 3
    RULE_context = 4
    RULE_numberLiteral = 5
    RULE_numberLiteralPrecision = 6
    RULE_numberLiteralExponent = 7

    ruleNames =  [ "prog", "expr", "expressionList", "symbol", "context", 
                   "numberLiteral", "numberLiteralPrecision", "numberLiteralExponent" ]

    EOF = Token.EOF
    Name=1
    DecimalNumber=2
    NumberInBase=3
    DIGITS=4
    StringLiteral=5
    PLUS=6
    MINUS=7
    COMMENT=8
    LBRACKET=9
    RBRACKET=10
    COMMA=11
    LCOMMENT=12
    RCOMMENT=13
    DOUBLEBACKQUOTE=14
    BACKQUOTE=15
    SINGLEQUOTE=16
    QUOTE=17
    RAWCOLON=18
    RAWBACKSLASH=19
    DOUBLECARET=20
    ASTERISKCARET=21
    DOT=22
    NEWLINE=23
    CONTINUATION=24
    WHITESPACE=25

    def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
        super().__init__(input, output)
        self.checkVersion("4.7.2")
        self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
        self._predicates = None



    class ProgContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(FullFormParser.ExprContext)
            else:
                return self.getTypedRuleContext(FullFormParser.ExprContext,i)


        def NEWLINE(self, i:int=None):
            if i is None:
                return self.getTokens(FullFormParser.NEWLINE)
            else:
                return self.getToken(FullFormParser.NEWLINE, i)

        def getRuleIndex(self):
            return FullFormParser.RULE_prog

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterProg" ):
                listener.enterProg(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitProg" ):
                listener.exitProg(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitProg" ):
                return visitor.visitProg(self)
            else:
                return visitor.visitChildren(self)




    def prog(self):

        localctx = FullFormParser.ProgContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_prog)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 16
            self.expr(0)
            self.state = 27
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==FullFormParser.NEWLINE:
                self.state = 18 
                self._errHandler.sync(self)
                _alt = 1
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt == 1:
                        self.state = 17
                        self.match(FullFormParser.NEWLINE)

                    else:
                        raise NoViableAltException(self)
                    self.state = 20 
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,0,self._ctx)

                self.state = 23
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << FullFormParser.Name) | (1 << FullFormParser.DecimalNumber) | (1 << FullFormParser.DIGITS) | (1 << FullFormParser.StringLiteral) | (1 << FullFormParser.MINUS) | (1 << FullFormParser.BACKQUOTE))) != 0):
                    self.state = 22
                    self.expr(0)


                self.state = 29
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ExprContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser


        def getRuleIndex(self):
            return FullFormParser.RULE_expr

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)


    class NumberContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a FullFormParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def numberLiteral(self):
            return self.getTypedRuleContext(FullFormParser.NumberLiteralContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNumber" ):
                listener.enterNumber(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNumber" ):
                listener.exitNumber(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitNumber" ):
                return visitor.visitNumber(self)
            else:
                return visitor.visitChildren(self)


    class StringLiteralContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a FullFormParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def StringLiteral(self):
            return self.getToken(FullFormParser.StringLiteral, 0)

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStringLiteral" ):
                listener.enterStringLiteral(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStringLiteral" ):
                listener.exitStringLiteral(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStringLiteral" ):
                return visitor.visitStringLiteral(self)
            else:
                return visitor.visitChildren(self)


    class SymbolLiteralContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a FullFormParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def symbol(self):
            return self.getTypedRuleContext(FullFormParser.SymbolContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSymbolLiteral" ):
                listener.enterSymbolLiteral(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSymbolLiteral" ):
                listener.exitSymbolLiteral(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitSymbolLiteral" ):
                return visitor.visitSymbolLiteral(self)
            else:
                return visitor.visitChildren(self)


    class HeadExpressionContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a FullFormParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self):
            return self.getTypedRuleContext(FullFormParser.ExprContext,0)

        def LBRACKET(self):
            return self.getToken(FullFormParser.LBRACKET, 0)
        def expressionList(self):
            return self.getTypedRuleContext(FullFormParser.ExpressionListContext,0)

        def RBRACKET(self):
            return self.getToken(FullFormParser.RBRACKET, 0)

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterHeadExpression" ):
                listener.enterHeadExpression(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitHeadExpression" ):
                listener.exitHeadExpression(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitHeadExpression" ):
                return visitor.visitHeadExpression(self)
            else:
                return visitor.visitChildren(self)



    def expr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = FullFormParser.ExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 2
        self.enterRecursionRule(localctx, 2, self.RULE_expr, _p)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 34
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [FullFormParser.DecimalNumber, FullFormParser.DIGITS, FullFormParser.MINUS]:
                localctx = FullFormParser.NumberContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 31
                self.numberLiteral()
                pass
            elif token in [FullFormParser.StringLiteral]:
                localctx = FullFormParser.StringLiteralContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 32
                self.match(FullFormParser.StringLiteral)
                pass
            elif token in [FullFormParser.Name, FullFormParser.BACKQUOTE]:
                localctx = FullFormParser.SymbolLiteralContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 33
                self.symbol()
                pass
            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 43
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,4,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    localctx = FullFormParser.HeadExpressionContext(self, FullFormParser.ExprContext(self, _parentctx, _parentState))
                    self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                    self.state = 36
                    if not self.precpred(self._ctx, 1):
                        from antlr4.error.Errors import FailedPredicateException
                        raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
                    self.state = 37
                    self.match(FullFormParser.LBRACKET)
                    self.state = 38
                    self.expressionList()
                    self.state = 39
                    self.match(FullFormParser.RBRACKET) 
                self.state = 45
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,4,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.unrollRecursionContexts(_parentctx)
        return localctx

    class ExpressionListContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser


        def getRuleIndex(self):
            return FullFormParser.RULE_expressionList

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class ExpressionListedContext(ExpressionListContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a FullFormParser.ExpressionListContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(FullFormParser.ExprContext)
            else:
                return self.getTypedRuleContext(FullFormParser.ExprContext,i)

        def COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(FullFormParser.COMMA)
            else:
                return self.getToken(FullFormParser.COMMA, i)

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpressionListed" ):
                listener.enterExpressionListed(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpressionListed" ):
                listener.exitExpressionListed(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpressionListed" ):
                return visitor.visitExpressionListed(self)
            else:
                return visitor.visitChildren(self)



    def expressionList(self):

        localctx = FullFormParser.ExpressionListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_expressionList)
        self._la = 0 # Token type
        try:
            localctx = FullFormParser.ExpressionListedContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 47
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << FullFormParser.Name) | (1 << FullFormParser.DecimalNumber) | (1 << FullFormParser.DIGITS) | (1 << FullFormParser.StringLiteral) | (1 << FullFormParser.MINUS) | (1 << FullFormParser.BACKQUOTE))) != 0):
                self.state = 46
                self.expr(0)


            self.state = 55
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==FullFormParser.COMMA:
                self.state = 49
                self.match(FullFormParser.COMMA)
                self.state = 51
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << FullFormParser.Name) | (1 << FullFormParser.DecimalNumber) | (1 << FullFormParser.DIGITS) | (1 << FullFormParser.StringLiteral) | (1 << FullFormParser.MINUS) | (1 << FullFormParser.BACKQUOTE))) != 0):
                    self.state = 50
                    self.expr(0)


                self.state = 57
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class SymbolContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser


        def getRuleIndex(self):
            return FullFormParser.RULE_symbol

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class ContextNameContext(SymbolContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a FullFormParser.SymbolContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def Name(self):
            return self.getToken(FullFormParser.Name, 0)
        def context(self):
            return self.getTypedRuleContext(FullFormParser.ContextContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterContextName" ):
                listener.enterContextName(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitContextName" ):
                listener.exitContextName(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitContextName" ):
                return visitor.visitContextName(self)
            else:
                return visitor.visitChildren(self)



    def symbol(self):

        localctx = FullFormParser.SymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_symbol)
        try:
            localctx = FullFormParser.ContextNameContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 59
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,8,self._ctx)
            if la_ == 1:
                self.state = 58
                self.context()


            self.state = 61
            self.match(FullFormParser.Name)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ContextContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser


        def getRuleIndex(self):
            return FullFormParser.RULE_context

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class SimpleContextContext(ContextContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a FullFormParser.ContextContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def Name(self):
            return self.getToken(FullFormParser.Name, 0)
        def BACKQUOTE(self, i:int=None):
            if i is None:
                return self.getTokens(FullFormParser.BACKQUOTE)
            else:
                return self.getToken(FullFormParser.BACKQUOTE, i)

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSimpleContext" ):
                listener.enterSimpleContext(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSimpleContext" ):
                listener.exitSimpleContext(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitSimpleContext" ):
                return visitor.visitSimpleContext(self)
            else:
                return visitor.visitChildren(self)


    class CompoundContextContext(ContextContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a FullFormParser.ContextContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def Name(self, i:int=None):
            if i is None:
                return self.getTokens(FullFormParser.Name)
            else:
                return self.getToken(FullFormParser.Name, i)
        def BACKQUOTE(self, i:int=None):
            if i is None:
                return self.getTokens(FullFormParser.BACKQUOTE)
            else:
                return self.getToken(FullFormParser.BACKQUOTE, i)

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCompoundContext" ):
                listener.enterCompoundContext(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCompoundContext" ):
                listener.exitCompoundContext(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitCompoundContext" ):
                return visitor.visitCompoundContext(self)
            else:
                return visitor.visitChildren(self)



    def context(self):

        localctx = FullFormParser.ContextContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_context)
        self._la = 0 # Token type
        try:
            self.state = 72
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,10,self._ctx)
            if la_ == 1:
                localctx = FullFormParser.SimpleContextContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 64
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==FullFormParser.BACKQUOTE:
                    self.state = 63
                    self.match(FullFormParser.BACKQUOTE)


                self.state = 66
                self.match(FullFormParser.Name)
                self.state = 67
                self.match(FullFormParser.BACKQUOTE)
                pass

            elif la_ == 2:
                localctx = FullFormParser.CompoundContextContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 68
                self.match(FullFormParser.Name)
                self.state = 69
                self.match(FullFormParser.BACKQUOTE)
                self.state = 70
                self.match(FullFormParser.Name)
                self.state = 71
                self.match(FullFormParser.BACKQUOTE)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class NumberLiteralContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser


        def getRuleIndex(self):
            return FullFormParser.RULE_numberLiteral

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class NumberBaseNContext(NumberLiteralContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a FullFormParser.NumberLiteralContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def DIGITS(self):
            return self.getToken(FullFormParser.DIGITS, 0)
        def NumberInBase(self):
            return self.getToken(FullFormParser.NumberInBase, 0)
        def MINUS(self):
            return self.getToken(FullFormParser.MINUS, 0)
        def numberLiteralPrecision(self):
            return self.getTypedRuleContext(FullFormParser.NumberLiteralPrecisionContext,0)

        def numberLiteralExponent(self):
            return self.getTypedRuleContext(FullFormParser.NumberLiteralExponentContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNumberBaseN" ):
                listener.enterNumberBaseN(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNumberBaseN" ):
                listener.exitNumberBaseN(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitNumberBaseN" ):
                return visitor.visitNumberBaseN(self)
            else:
                return visitor.visitChildren(self)


    class NumberBaseTenContext(NumberLiteralContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a FullFormParser.NumberLiteralContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def DIGITS(self):
            return self.getToken(FullFormParser.DIGITS, 0)
        def DecimalNumber(self):
            return self.getToken(FullFormParser.DecimalNumber, 0)
        def MINUS(self):
            return self.getToken(FullFormParser.MINUS, 0)
        def numberLiteralPrecision(self):
            return self.getTypedRuleContext(FullFormParser.NumberLiteralPrecisionContext,0)

        def numberLiteralExponent(self):
            return self.getTypedRuleContext(FullFormParser.NumberLiteralExponentContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNumberBaseTen" ):
                listener.enterNumberBaseTen(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNumberBaseTen" ):
                listener.exitNumberBaseTen(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitNumberBaseTen" ):
                return visitor.visitNumberBaseTen(self)
            else:
                return visitor.visitChildren(self)



    def numberLiteral(self):

        localctx = FullFormParser.NumberLiteralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_numberLiteral)
        self._la = 0 # Token type
        try:
            self.state = 95
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,17,self._ctx)
            if la_ == 1:
                localctx = FullFormParser.NumberBaseNContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 75
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==FullFormParser.MINUS:
                    self.state = 74
                    self.match(FullFormParser.MINUS)


                self.state = 77
                self.match(FullFormParser.DIGITS)
                self.state = 78
                self.match(FullFormParser.NumberInBase)
                self.state = 80
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,12,self._ctx)
                if la_ == 1:
                    self.state = 79
                    self.numberLiteralPrecision()


                self.state = 83
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,13,self._ctx)
                if la_ == 1:
                    self.state = 82
                    self.numberLiteralExponent()


                pass

            elif la_ == 2:
                localctx = FullFormParser.NumberBaseTenContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 86
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==FullFormParser.MINUS:
                    self.state = 85
                    self.match(FullFormParser.MINUS)


                self.state = 88
                _la = self._input.LA(1)
                if not(_la==FullFormParser.DecimalNumber or _la==FullFormParser.DIGITS):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 90
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,15,self._ctx)
                if la_ == 1:
                    self.state = 89
                    self.numberLiteralPrecision()


                self.state = 93
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,16,self._ctx)
                if la_ == 1:
                    self.state = 92
                    self.numberLiteralExponent()


                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class NumberLiteralPrecisionContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DOUBLEBACKQUOTE(self):
            return self.getToken(FullFormParser.DOUBLEBACKQUOTE, 0)

        def DecimalNumber(self):
            return self.getToken(FullFormParser.DecimalNumber, 0)

        def DIGITS(self):
            return self.getToken(FullFormParser.DIGITS, 0)

        def BACKQUOTE(self):
            return self.getToken(FullFormParser.BACKQUOTE, 0)

        def getRuleIndex(self):
            return FullFormParser.RULE_numberLiteralPrecision

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNumberLiteralPrecision" ):
                listener.enterNumberLiteralPrecision(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNumberLiteralPrecision" ):
                listener.exitNumberLiteralPrecision(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitNumberLiteralPrecision" ):
                return visitor.visitNumberLiteralPrecision(self)
            else:
                return visitor.visitChildren(self)




    def numberLiteralPrecision(self):

        localctx = FullFormParser.NumberLiteralPrecisionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_numberLiteralPrecision)
        self._la = 0 # Token type
        try:
            self.state = 103
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [FullFormParser.DOUBLEBACKQUOTE]:
                self.enterOuterAlt(localctx, 1)
                self.state = 97
                self.match(FullFormParser.DOUBLEBACKQUOTE)
                self.state = 98
                _la = self._input.LA(1)
                if not(_la==FullFormParser.DecimalNumber or _la==FullFormParser.DIGITS):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass
            elif token in [FullFormParser.BACKQUOTE]:
                self.enterOuterAlt(localctx, 2)
                self.state = 99
                self.match(FullFormParser.BACKQUOTE)
                self.state = 101
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,18,self._ctx)
                if la_ == 1:
                    self.state = 100
                    _la = self._input.LA(1)
                    if not(_la==FullFormParser.DecimalNumber or _la==FullFormParser.DIGITS):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class NumberLiteralExponentContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ASTERISKCARET(self):
            return self.getToken(FullFormParser.ASTERISKCARET, 0)

        def DIGITS(self):
            return self.getToken(FullFormParser.DIGITS, 0)

        def PLUS(self):
            return self.getToken(FullFormParser.PLUS, 0)

        def MINUS(self):
            return self.getToken(FullFormParser.MINUS, 0)

        def getRuleIndex(self):
            return FullFormParser.RULE_numberLiteralExponent

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNumberLiteralExponent" ):
                listener.enterNumberLiteralExponent(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNumberLiteralExponent" ):
                listener.exitNumberLiteralExponent(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitNumberLiteralExponent" ):
                return visitor.visitNumberLiteralExponent(self)
            else:
                return visitor.visitChildren(self)




    def numberLiteralExponent(self):

        localctx = FullFormParser.NumberLiteralExponentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_numberLiteralExponent)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 105
            self.match(FullFormParser.ASTERISKCARET)
            self.state = 107
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==FullFormParser.PLUS or _la==FullFormParser.MINUS:
                self.state = 106
                _la = self._input.LA(1)
                if not(_la==FullFormParser.PLUS or _la==FullFormParser.MINUS):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


            self.state = 109
            self.match(FullFormParser.DIGITS)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx



    def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[1] = self.expr_sempred
        pred = self._predicates.get(ruleIndex, None)
        if pred is None:
            raise Exception("No predicate with index:" + str(ruleIndex))
        else:
            return pred(localctx, predIndex)

    def expr_sempred(self, localctx:ExprContext, predIndex:int):
            if predIndex == 0:
                return self.precpred(self._ctx, 1)
         




