public final NTSParser.literal_return literal() throws RecognitionException {
        NTSParser.literal_return retval = new NTSParser.literal_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token li=null;
        Token lr=null;
        NTSParser.boollit_return boollit161 = null;


        CommonTree li_tree=null;
        CommonTree lr_tree=null;

        try {
            // /home/filip/workspace/nts/src/nts/parser/NTS.g:812:3: ( boollit | li= LITINT | lr= LITREAL )
            int alt49=3;
            switch ( input.LA(1) ) {
            case TRUE:
            case FALSE:
                {
                alt49=1;
                }
                break;
            case LITINT:
                {
                alt49=2;
                }
                break;
            case LITREAL:
                {
                alt49=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 49, 0, input);

                throw nvae;
            }

            switch (alt49) {
                case 1 :
                    // /home/filip/workspace/nts/src/nts/parser/NTS.g:812:5: boollit
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    pushFollow(FOLLOW_boollit_in_literal3027);
                    boollit161=boollit();

                    state._fsp--;

                    adaptor.addChild(root_0, boollit161.getTree());

                    }
                    break;
                case 2 :
                    // /home/filip/workspace/nts/src/nts/parser/NTS.g:813:5: li= LITINT
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    li=(Token)match(input,LITINT,FOLLOW_LITINT_in_literal3035); 
                    li_tree = (CommonTree)adaptor.create(li);
                    adaptor.addChild(root_0, li_tree);

                     listener.litInt(li); 

                    }
                    break;
                case 3 :
                    // /home/filip/workspace/nts/src/nts/parser/NTS.g:814:5: lr= LITREAL
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    lr=(Token)match(input,LITREAL,FOLLOW_LITREAL_in_literal3045); 
                    lr_tree = (CommonTree)adaptor.create(lr);
                    adaptor.addChild(root_0, lr_tree);

                     listener.litReal(lr); 

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }

          catch (RecognitionException ex) {
            reportError(ex);
            System.exit(1);
          }
        finally {
        }
        return retval;
    }