# Generated from APIParser.g4 by ANTLR 4.11.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
	from typing import TextIO
else:
	from typing.io import TextIO

def serializedATN():
    return [
        4,1,106,331,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,
        7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,
        13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,
        20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,
        26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,
        33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,1,0,1,0,1,0,1,1,1,1,1,1,3,
        1,81,8,1,1,2,1,2,1,3,4,3,86,8,3,11,3,12,3,87,1,4,1,4,5,4,92,8,4,
        10,4,12,4,95,9,4,1,4,1,4,1,4,1,5,1,5,1,5,3,5,103,8,5,1,6,1,6,1,6,
        1,7,1,7,1,8,1,8,1,9,5,9,113,8,9,10,9,12,9,116,9,9,1,10,1,10,1,10,
        1,10,1,11,1,11,1,12,1,12,1,12,1,13,1,13,4,13,129,8,13,11,13,12,13,
        130,1,14,4,14,134,8,14,11,14,12,14,135,1,14,1,14,1,15,1,15,1,15,
        1,15,1,16,1,16,1,17,1,17,4,17,148,8,17,11,17,12,17,149,1,18,1,18,
        1,19,4,19,155,8,19,11,19,12,19,156,1,20,1,20,1,20,1,20,1,20,1,20,
        1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,3,20,175,8,20,
        1,21,1,21,3,21,179,8,21,1,21,3,21,182,8,21,1,21,3,21,185,8,21,1,
        22,1,22,3,22,189,8,22,1,22,3,22,192,8,22,1,22,3,22,195,8,22,1,23,
        1,23,1,23,3,23,200,8,23,1,23,3,23,203,8,23,1,24,1,24,1,24,3,24,208,
        8,24,1,24,3,24,211,8,24,1,25,1,25,1,25,1,25,5,25,217,8,25,10,25,
        12,25,220,9,25,1,25,3,25,223,8,25,1,25,3,25,226,8,25,1,25,3,25,229,
        8,25,1,25,3,25,232,8,25,1,26,1,26,1,26,4,26,237,8,26,11,26,12,26,
        238,1,26,3,26,242,8,26,1,26,3,26,245,8,26,1,27,1,27,1,27,3,27,250,
        8,27,1,27,3,27,253,8,27,1,28,1,28,1,28,1,29,1,29,1,29,1,29,1,29,
        1,29,1,29,3,29,265,8,29,1,29,3,29,268,8,29,1,29,3,29,271,8,29,1,
        30,1,30,1,30,3,30,276,8,30,1,30,3,30,279,8,30,1,31,1,31,3,31,283,
        8,31,1,31,3,31,286,8,31,1,32,1,32,1,32,1,32,3,32,292,8,32,1,32,3,
        32,295,8,32,1,33,1,33,1,33,3,33,300,8,33,1,33,3,33,303,8,33,1,34,
        1,34,1,34,3,34,308,8,34,1,35,1,35,1,35,3,35,313,8,35,1,36,1,36,3,
        36,317,8,36,1,36,5,36,320,8,36,10,36,12,36,323,9,36,1,36,3,36,326,
        8,36,1,36,3,36,329,8,36,1,36,0,0,37,0,2,4,6,8,10,12,14,16,18,20,
        22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,
        66,68,70,72,0,6,2,0,12,20,39,39,1,1,43,43,2,0,7,7,39,39,1,0,102,
        103,1,0,94,95,1,1,7,7,359,0,74,1,0,0,0,2,80,1,0,0,0,4,82,1,0,0,0,
        6,85,1,0,0,0,8,89,1,0,0,0,10,99,1,0,0,0,12,104,1,0,0,0,14,107,1,
        0,0,0,16,109,1,0,0,0,18,114,1,0,0,0,20,117,1,0,0,0,22,121,1,0,0,
        0,24,123,1,0,0,0,26,128,1,0,0,0,28,133,1,0,0,0,30,139,1,0,0,0,32,
        143,1,0,0,0,34,147,1,0,0,0,36,151,1,0,0,0,38,154,1,0,0,0,40,174,
        1,0,0,0,42,176,1,0,0,0,44,186,1,0,0,0,46,196,1,0,0,0,48,204,1,0,
        0,0,50,212,1,0,0,0,52,233,1,0,0,0,54,246,1,0,0,0,56,254,1,0,0,0,
        58,257,1,0,0,0,60,272,1,0,0,0,62,280,1,0,0,0,64,287,1,0,0,0,66,296,
        1,0,0,0,68,304,1,0,0,0,70,309,1,0,0,0,72,314,1,0,0,0,74,75,3,2,1,
        0,75,76,5,0,0,1,76,1,1,0,0,0,77,81,3,40,20,0,78,81,3,8,4,0,79,81,
        5,0,0,1,80,77,1,0,0,0,80,78,1,0,0,0,80,79,1,0,0,0,81,3,1,0,0,0,82,
        83,7,0,0,0,83,5,1,0,0,0,84,86,3,4,2,0,85,84,1,0,0,0,86,87,1,0,0,
        0,87,85,1,0,0,0,87,88,1,0,0,0,88,7,1,0,0,0,89,93,5,1,0,0,90,92,5,
        7,0,0,91,90,1,0,0,0,92,95,1,0,0,0,93,91,1,0,0,0,93,94,1,0,0,0,94,
        96,1,0,0,0,95,93,1,0,0,0,96,97,3,10,5,0,97,98,7,1,0,0,98,9,1,0,0,
        0,99,100,3,12,6,0,100,102,3,18,9,0,101,103,3,26,13,0,102,101,1,0,
        0,0,102,103,1,0,0,0,103,11,1,0,0,0,104,105,3,14,7,0,105,106,3,16,
        8,0,106,13,1,0,0,0,107,108,5,42,0,0,108,15,1,0,0,0,109,110,5,46,
        0,0,110,17,1,0,0,0,111,113,3,20,10,0,112,111,1,0,0,0,113,116,1,0,
        0,0,114,112,1,0,0,0,114,115,1,0,0,0,115,19,1,0,0,0,116,114,1,0,0,
        0,117,118,3,22,11,0,118,119,5,48,0,0,119,120,3,24,12,0,120,21,1,
        0,0,0,121,122,5,47,0,0,122,23,1,0,0,0,123,124,5,50,0,0,124,125,5,
        51,0,0,125,25,1,0,0,0,126,129,3,28,14,0,127,129,3,34,17,0,128,126,
        1,0,0,0,128,127,1,0,0,0,129,130,1,0,0,0,130,128,1,0,0,0,130,131,
        1,0,0,0,131,27,1,0,0,0,132,134,3,30,15,0,133,132,1,0,0,0,134,135,
        1,0,0,0,135,133,1,0,0,0,135,136,1,0,0,0,136,137,1,0,0,0,137,138,
        5,52,0,0,138,29,1,0,0,0,139,140,3,32,16,0,140,141,3,18,9,0,141,142,
        3,34,17,0,142,31,1,0,0,0,143,144,5,53,0,0,144,33,1,0,0,0,145,148,
        3,36,18,0,146,148,3,38,19,0,147,145,1,0,0,0,147,146,1,0,0,0,148,
        149,1,0,0,0,149,147,1,0,0,0,149,150,1,0,0,0,150,35,1,0,0,0,151,152,
        5,56,0,0,152,37,1,0,0,0,153,155,7,2,0,0,154,153,1,0,0,0,155,156,
        1,0,0,0,156,154,1,0,0,0,156,157,1,0,0,0,157,39,1,0,0,0,158,175,3,
        54,27,0,159,175,3,52,26,0,160,175,3,56,28,0,161,175,3,50,25,0,162,
        175,3,58,29,0,163,175,3,60,30,0,164,175,3,62,31,0,165,175,3,64,32,
        0,166,175,3,72,36,0,167,175,3,46,23,0,168,175,3,42,21,0,169,175,
        3,44,22,0,170,175,3,48,24,0,171,175,3,66,33,0,172,175,3,70,35,0,
        173,175,3,68,34,0,174,158,1,0,0,0,174,159,1,0,0,0,174,160,1,0,0,
        0,174,161,1,0,0,0,174,162,1,0,0,0,174,163,1,0,0,0,174,164,1,0,0,
        0,174,165,1,0,0,0,174,166,1,0,0,0,174,167,1,0,0,0,174,168,1,0,0,
        0,174,169,1,0,0,0,174,170,1,0,0,0,174,171,1,0,0,0,174,172,1,0,0,
        0,174,173,1,0,0,0,175,41,1,0,0,0,176,178,5,22,0,0,177,179,5,37,0,
        0,178,177,1,0,0,0,178,179,1,0,0,0,179,181,1,0,0,0,180,182,5,9,0,
        0,181,180,1,0,0,0,181,182,1,0,0,0,182,184,1,0,0,0,183,185,5,7,0,
        0,184,183,1,0,0,0,184,185,1,0,0,0,185,43,1,0,0,0,186,188,5,23,0,
        0,187,189,5,37,0,0,188,187,1,0,0,0,188,189,1,0,0,0,189,191,1,0,0,
        0,190,192,5,9,0,0,191,190,1,0,0,0,191,192,1,0,0,0,192,194,1,0,0,
        0,193,195,5,7,0,0,194,193,1,0,0,0,194,195,1,0,0,0,195,45,1,0,0,0,
        196,197,5,26,0,0,197,199,7,3,0,0,198,200,5,105,0,0,199,198,1,0,0,
        0,199,200,1,0,0,0,200,202,1,0,0,0,201,203,5,7,0,0,202,201,1,0,0,
        0,202,203,1,0,0,0,203,47,1,0,0,0,204,205,5,25,0,0,205,207,5,37,0,
        0,206,208,5,9,0,0,207,206,1,0,0,0,207,208,1,0,0,0,208,210,1,0,0,
        0,209,211,5,7,0,0,210,209,1,0,0,0,210,211,1,0,0,0,211,49,1,0,0,0,
        212,213,5,29,0,0,213,218,5,71,0,0,214,215,5,70,0,0,215,217,5,71,
        0,0,216,214,1,0,0,0,217,220,1,0,0,0,218,216,1,0,0,0,218,219,1,0,
        0,0,219,222,1,0,0,0,220,218,1,0,0,0,221,223,5,68,0,0,222,221,1,0,
        0,0,222,223,1,0,0,0,223,225,1,0,0,0,224,226,5,69,0,0,225,224,1,0,
        0,0,225,226,1,0,0,0,226,228,1,0,0,0,227,229,5,9,0,0,228,227,1,0,
        0,0,228,229,1,0,0,0,229,231,1,0,0,0,230,232,5,7,0,0,231,230,1,0,
        0,0,231,232,1,0,0,0,232,51,1,0,0,0,233,234,5,30,0,0,234,236,5,64,
        0,0,235,237,5,65,0,0,236,235,1,0,0,0,237,238,1,0,0,0,238,236,1,0,
        0,0,238,239,1,0,0,0,239,241,1,0,0,0,240,242,5,9,0,0,241,240,1,0,
        0,0,241,242,1,0,0,0,242,244,1,0,0,0,243,245,5,7,0,0,244,243,1,0,
        0,0,244,245,1,0,0,0,245,53,1,0,0,0,246,247,5,28,0,0,247,249,5,62,
        0,0,248,250,5,9,0,0,249,248,1,0,0,0,249,250,1,0,0,0,250,252,1,0,
        0,0,251,253,5,7,0,0,252,251,1,0,0,0,252,253,1,0,0,0,253,55,1,0,0,
        0,254,255,5,31,0,0,255,256,5,75,0,0,256,57,1,0,0,0,257,264,5,35,
        0,0,258,265,5,86,0,0,259,265,5,87,0,0,260,265,5,88,0,0,261,262,5,
        82,0,0,262,263,5,83,0,0,263,265,5,89,0,0,264,258,1,0,0,0,264,259,
        1,0,0,0,264,260,1,0,0,0,264,261,1,0,0,0,265,267,1,0,0,0,266,268,
        5,80,0,0,267,266,1,0,0,0,267,268,1,0,0,0,268,270,1,0,0,0,269,271,
        5,7,0,0,270,269,1,0,0,0,270,271,1,0,0,0,271,59,1,0,0,0,272,273,5,
        32,0,0,273,275,5,79,0,0,274,276,5,9,0,0,275,274,1,0,0,0,275,276,
        1,0,0,0,276,278,1,0,0,0,277,279,5,7,0,0,278,277,1,0,0,0,278,279,
        1,0,0,0,279,61,1,0,0,0,280,282,5,33,0,0,281,283,5,9,0,0,282,281,
        1,0,0,0,282,283,1,0,0,0,283,285,1,0,0,0,284,286,5,7,0,0,285,284,
        1,0,0,0,285,286,1,0,0,0,286,63,1,0,0,0,287,288,5,36,0,0,288,289,
        5,92,0,0,289,291,7,4,0,0,290,292,5,93,0,0,291,290,1,0,0,0,291,292,
        1,0,0,0,292,294,1,0,0,0,293,295,5,7,0,0,294,293,1,0,0,0,294,295,
        1,0,0,0,295,65,1,0,0,0,296,297,5,24,0,0,297,299,5,39,0,0,298,300,
        5,9,0,0,299,298,1,0,0,0,299,300,1,0,0,0,300,302,1,0,0,0,301,303,
        5,7,0,0,302,301,1,0,0,0,302,303,1,0,0,0,303,67,1,0,0,0,304,305,5,
        27,0,0,305,307,5,58,0,0,306,308,7,5,0,0,307,306,1,0,0,0,307,308,
        1,0,0,0,308,69,1,0,0,0,309,310,5,2,0,0,310,312,5,57,0,0,311,313,
        5,7,0,0,312,311,1,0,0,0,312,313,1,0,0,0,313,71,1,0,0,0,314,316,5,
        34,0,0,315,317,5,100,0,0,316,315,1,0,0,0,316,317,1,0,0,0,317,321,
        1,0,0,0,318,320,5,98,0,0,319,318,1,0,0,0,320,323,1,0,0,0,321,319,
        1,0,0,0,321,322,1,0,0,0,322,325,1,0,0,0,323,321,1,0,0,0,324,326,
        5,99,0,0,325,324,1,0,0,0,325,326,1,0,0,0,326,328,1,0,0,0,327,329,
        5,7,0,0,328,327,1,0,0,0,328,329,1,0,0,0,329,73,1,0,0,0,49,80,87,
        93,102,114,128,130,135,147,149,156,174,178,181,184,188,191,194,199,
        202,207,210,218,222,225,228,231,238,241,244,249,252,264,267,270,
        275,278,282,285,291,294,299,302,307,312,316,321,325,328
    ]

class APIParser ( Parser ):

    grammarFileName = "APIParser.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>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "'.'", "<INVALID>", 
                     "'('", "')'", "'['", "']'", "'\"'", "'''", "'\\'", 
                     "<INVALID>", "'_EXIT'", "'_QUIT'", "'_SPOOL'", "'_SLEEP'", 
                     "'_USE'", "<INVALID>", "'_ASSERT'", "'_START'", "'_LOAD'", 
                     "'_HOST'", "'_IF'", "'_ENDIF'", "'_SET'", "'_LOOP'", 
                     "'_WHENEVER'", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "'###'", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "'LOOP'", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "'\"\"\"'", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "'BEGIN'", "'UNTIL'", "<INVALID>", "<INVALID>", "'BREAK'", 
                     "'END'", "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "'ERROR'", "<INVALID>", "<INVALID>", "'EXIT'", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "'API'", "'SQL'" ]

    symbolicNames = [ "<INVALID>", "HTTP_OPEN", "SCRIPT_OPEN", "COMMENT_OPEN", 
                      "MINUS_MINUS_HINT", "MINUS_MINUS_COMMENT", "HASH_COMMENT", 
                      "CRLF", "COMMA", "SEMICOLON", "COLON", "AT", "DOT", 
                      "SLASH", "BRACKET_OPEN", "BRACKET_CLOSE", "SQUARE_OPEN", 
                      "SQUARE_CLOSE", "DOUBLE_QUOTE", "SINGLE_QUOTE", "ESCAPE", 
                      "SPACE", "EXIT", "QUIT", "SPOOL", "SLEEP", "USE", 
                      "ECHO_OPEN", "ASSERT", "START", "LOAD", "HOST", "IF", 
                      "ENDIF", "SET", "LOOP", "WHENEVER", "INT", "DECIMAL", 
                      "String", "DIVIDE", "SP", "HttpMethod", "HTTP_CLOSE", 
                      "HttpHint", "HttpComment", "HttpRequestTarget", "HttpHeaderFieldName", 
                      "FIELD_COLON", "FIELD_CRLF", "HttpHeaderFieldValue", 
                      "HttpHeaderFieldValueEnd", "HttpMultipartBoundaryEnd", 
                      "HttpMultipartBoundary", "HttpMessageBodyHint", "HttpMessageBodyComment", 
                      "HttpMessageBodyOperate", "ScriptBlock", "EchoBlock", 
                      "ASSERT_SPACE", "ASSERT_OPEN", "ASSERT_CLOSE", "ASSERT_EXPRESSION", 
                      "LOAD_SPACE", "LOAD_OPTION", "LOAD_EXPRESSION", "LOAD_CRLF", 
                      "START_SPACE", "START_LOOP", "START_INT", "START_COMMA", 
                      "START_EXPRESSION", "START_CRLF", "HOST_SPACE", "HOST_TAG", 
                      "HOST_BLOCK", "IF_SPACE", "IF_OPEN", "IF_CLOSE", "IF_EXPRESSION", 
                      "LOOP_SEMICOLON", "LOOP_SPACE", "LOOP_BEGIN", "LOOP_UNTIL", 
                      "LOOP_OPEN", "LOOP_CLOSE", "LOOP_BREAK", "LOOP_END", 
                      "LOOP_CONTINUE", "LOOP_EXPRESSION", "LOOP_CRLF", "WHENEVER_SPACE", 
                      "WHENEVER_ERROR", "WHENEVER_SEMICOLON", "WHENEVER_CONTINUE", 
                      "WHENEVER_EXIT", "WHENEVER_CRLF", "SET_SPACE", "SET_EXPRESSION", 
                      "SET_SEMICOLON", "SET_AT", "SET_CRLF", "USE_API", 
                      "USE_SQL", "USE_SPACE", "USE_SEMICOLON", "USE_CRLF" ]

    RULE_prog = 0
    RULE_command = 1
    RULE_singleExpression = 2
    RULE_expression = 3
    RULE_http = 4
    RULE_httpMessage = 5
    RULE_httpRequestLine = 6
    RULE_httpMethod = 7
    RULE_httpRequestTarget = 8
    RULE_httpHeaderFields = 9
    RULE_httpHeaderField = 10
    RULE_httpHeaderFieldName = 11
    RULE_httpHeaderFieldValue = 12
    RULE_httpMessageBody = 13
    RULE_httpMultipart = 14
    RULE_httpMultipartBoundary = 15
    RULE_httpBoundaryDelimiter = 16
    RULE_httpMessageBodyContent = 17
    RULE_httpMessageBodyOperate = 18
    RULE_httpMessageBodyOther = 19
    RULE_baseCommand = 20
    RULE_exit = 21
    RULE_quit = 22
    RULE_use = 23
    RULE_sleep = 24
    RULE_start = 25
    RULE_load = 26
    RULE_assert = 27
    RULE_host = 28
    RULE_loop = 29
    RULE_if = 30
    RULE_endif = 31
    RULE_whenever = 32
    RULE_spool = 33
    RULE_echo = 34
    RULE_script = 35
    RULE_set = 36

    ruleNames =  [ "prog", "command", "singleExpression", "expression", 
                   "http", "httpMessage", "httpRequestLine", "httpMethod", 
                   "httpRequestTarget", "httpHeaderFields", "httpHeaderField", 
                   "httpHeaderFieldName", "httpHeaderFieldValue", "httpMessageBody", 
                   "httpMultipart", "httpMultipartBoundary", "httpBoundaryDelimiter", 
                   "httpMessageBodyContent", "httpMessageBodyOperate", "httpMessageBodyOther", 
                   "baseCommand", "exit", "quit", "use", "sleep", "start", 
                   "load", "assert", "host", "loop", "if", "endif", "whenever", 
                   "spool", "echo", "script", "set" ]

    EOF = Token.EOF
    HTTP_OPEN=1
    SCRIPT_OPEN=2
    COMMENT_OPEN=3
    MINUS_MINUS_HINT=4
    MINUS_MINUS_COMMENT=5
    HASH_COMMENT=6
    CRLF=7
    COMMA=8
    SEMICOLON=9
    COLON=10
    AT=11
    DOT=12
    SLASH=13
    BRACKET_OPEN=14
    BRACKET_CLOSE=15
    SQUARE_OPEN=16
    SQUARE_CLOSE=17
    DOUBLE_QUOTE=18
    SINGLE_QUOTE=19
    ESCAPE=20
    SPACE=21
    EXIT=22
    QUIT=23
    SPOOL=24
    SLEEP=25
    USE=26
    ECHO_OPEN=27
    ASSERT=28
    START=29
    LOAD=30
    HOST=31
    IF=32
    ENDIF=33
    SET=34
    LOOP=35
    WHENEVER=36
    INT=37
    DECIMAL=38
    String=39
    DIVIDE=40
    SP=41
    HttpMethod=42
    HTTP_CLOSE=43
    HttpHint=44
    HttpComment=45
    HttpRequestTarget=46
    HttpHeaderFieldName=47
    FIELD_COLON=48
    FIELD_CRLF=49
    HttpHeaderFieldValue=50
    HttpHeaderFieldValueEnd=51
    HttpMultipartBoundaryEnd=52
    HttpMultipartBoundary=53
    HttpMessageBodyHint=54
    HttpMessageBodyComment=55
    HttpMessageBodyOperate=56
    ScriptBlock=57
    EchoBlock=58
    ASSERT_SPACE=59
    ASSERT_OPEN=60
    ASSERT_CLOSE=61
    ASSERT_EXPRESSION=62
    LOAD_SPACE=63
    LOAD_OPTION=64
    LOAD_EXPRESSION=65
    LOAD_CRLF=66
    START_SPACE=67
    START_LOOP=68
    START_INT=69
    START_COMMA=70
    START_EXPRESSION=71
    START_CRLF=72
    HOST_SPACE=73
    HOST_TAG=74
    HOST_BLOCK=75
    IF_SPACE=76
    IF_OPEN=77
    IF_CLOSE=78
    IF_EXPRESSION=79
    LOOP_SEMICOLON=80
    LOOP_SPACE=81
    LOOP_BEGIN=82
    LOOP_UNTIL=83
    LOOP_OPEN=84
    LOOP_CLOSE=85
    LOOP_BREAK=86
    LOOP_END=87
    LOOP_CONTINUE=88
    LOOP_EXPRESSION=89
    LOOP_CRLF=90
    WHENEVER_SPACE=91
    WHENEVER_ERROR=92
    WHENEVER_SEMICOLON=93
    WHENEVER_CONTINUE=94
    WHENEVER_EXIT=95
    WHENEVER_CRLF=96
    SET_SPACE=97
    SET_EXPRESSION=98
    SET_SEMICOLON=99
    SET_AT=100
    SET_CRLF=101
    USE_API=102
    USE_SQL=103
    USE_SPACE=104
    USE_SEMICOLON=105
    USE_CRLF=106

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




    class ProgContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def command(self):
            return self.getTypedRuleContext(APIParser.CommandContext,0)


        def EOF(self):
            return self.getToken(APIParser.EOF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_prog

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




    def prog(self):

        localctx = APIParser.ProgContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_prog)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 74
            self.command()
            self.state = 75
            self.match(APIParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CommandContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def baseCommand(self):
            return self.getTypedRuleContext(APIParser.BaseCommandContext,0)


        def http(self):
            return self.getTypedRuleContext(APIParser.HttpContext,0)


        def EOF(self):
            return self.getToken(APIParser.EOF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_command

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




    def command(self):

        localctx = APIParser.CommandContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_command)
        try:
            self.state = 80
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36]:
                self.enterOuterAlt(localctx, 1)
                self.state = 77
                self.baseCommand()
                pass
            elif token in [1]:
                self.enterOuterAlt(localctx, 2)
                self.state = 78
                self.http()
                pass
            elif token in [-1]:
                self.enterOuterAlt(localctx, 3)
                self.state = 79
                self.match(APIParser.EOF)
                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 SingleExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def String(self):
            return self.getToken(APIParser.String, 0)

        def DOT(self):
            return self.getToken(APIParser.DOT, 0)

        def SLASH(self):
            return self.getToken(APIParser.SLASH, 0)

        def BRACKET_OPEN(self):
            return self.getToken(APIParser.BRACKET_OPEN, 0)

        def BRACKET_CLOSE(self):
            return self.getToken(APIParser.BRACKET_CLOSE, 0)

        def ESCAPE(self):
            return self.getToken(APIParser.ESCAPE, 0)

        def SQUARE_OPEN(self):
            return self.getToken(APIParser.SQUARE_OPEN, 0)

        def SQUARE_CLOSE(self):
            return self.getToken(APIParser.SQUARE_CLOSE, 0)

        def DOUBLE_QUOTE(self):
            return self.getToken(APIParser.DOUBLE_QUOTE, 0)

        def SINGLE_QUOTE(self):
            return self.getToken(APIParser.SINGLE_QUOTE, 0)

        def getRuleIndex(self):
            return APIParser.RULE_singleExpression

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




    def singleExpression(self):

        localctx = APIParser.SingleExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_singleExpression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 82
            _la = self._input.LA(1)
            if not(((_la) & ~0x3f) == 0 and ((1 << _la) & 549757906944) != 0):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def singleExpression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(APIParser.SingleExpressionContext)
            else:
                return self.getTypedRuleContext(APIParser.SingleExpressionContext,i)


        def getRuleIndex(self):
            return APIParser.RULE_expression

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




    def expression(self):

        localctx = APIParser.ExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_expression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 85 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 84
                self.singleExpression()
                self.state = 87 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (((_la) & ~0x3f) == 0 and ((1 << _la) & 549757906944) != 0):
                    break

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


    class HttpContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def HTTP_OPEN(self):
            return self.getToken(APIParser.HTTP_OPEN, 0)

        def httpMessage(self):
            return self.getTypedRuleContext(APIParser.HttpMessageContext,0)


        def HTTP_CLOSE(self):
            return self.getToken(APIParser.HTTP_CLOSE, 0)

        def EOF(self):
            return self.getToken(APIParser.EOF, 0)

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

        def getRuleIndex(self):
            return APIParser.RULE_http

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




    def http(self):

        localctx = APIParser.HttpContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_http)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 89
            self.match(APIParser.HTTP_OPEN)
            self.state = 93
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==7:
                self.state = 90
                self.match(APIParser.CRLF)
                self.state = 95
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 96
            self.httpMessage()
            self.state = 97
            _la = self._input.LA(1)
            if not(_la==-1 or _la==43):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HttpMessageContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def httpRequestLine(self):
            return self.getTypedRuleContext(APIParser.HttpRequestLineContext,0)


        def httpHeaderFields(self):
            return self.getTypedRuleContext(APIParser.HttpHeaderFieldsContext,0)


        def httpMessageBody(self):
            return self.getTypedRuleContext(APIParser.HttpMessageBodyContext,0)


        def getRuleIndex(self):
            return APIParser.RULE_httpMessage

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




    def httpMessage(self):

        localctx = APIParser.HttpMessageContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_httpMessage)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 99
            self.httpRequestLine()
            self.state = 100
            self.httpHeaderFields()
            self.state = 102
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((_la) & ~0x3f) == 0 and ((1 << _la) & 81065343048482944) != 0:
                self.state = 101
                self.httpMessageBody()


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


    class HttpRequestLineContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def httpMethod(self):
            return self.getTypedRuleContext(APIParser.HttpMethodContext,0)


        def httpRequestTarget(self):
            return self.getTypedRuleContext(APIParser.HttpRequestTargetContext,0)


        def getRuleIndex(self):
            return APIParser.RULE_httpRequestLine

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




    def httpRequestLine(self):

        localctx = APIParser.HttpRequestLineContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_httpRequestLine)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 104
            self.httpMethod()
            self.state = 105
            self.httpRequestTarget()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HttpMethodContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def HttpMethod(self):
            return self.getToken(APIParser.HttpMethod, 0)

        def getRuleIndex(self):
            return APIParser.RULE_httpMethod

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




    def httpMethod(self):

        localctx = APIParser.HttpMethodContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_httpMethod)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 107
            self.match(APIParser.HttpMethod)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HttpRequestTargetContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def HttpRequestTarget(self):
            return self.getToken(APIParser.HttpRequestTarget, 0)

        def getRuleIndex(self):
            return APIParser.RULE_httpRequestTarget

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




    def httpRequestTarget(self):

        localctx = APIParser.HttpRequestTargetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_httpRequestTarget)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 109
            self.match(APIParser.HttpRequestTarget)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HttpHeaderFieldsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def httpHeaderField(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(APIParser.HttpHeaderFieldContext)
            else:
                return self.getTypedRuleContext(APIParser.HttpHeaderFieldContext,i)


        def getRuleIndex(self):
            return APIParser.RULE_httpHeaderFields

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




    def httpHeaderFields(self):

        localctx = APIParser.HttpHeaderFieldsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_httpHeaderFields)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 114
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==47:
                self.state = 111
                self.httpHeaderField()
                self.state = 116
                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 HttpHeaderFieldContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def httpHeaderFieldName(self):
            return self.getTypedRuleContext(APIParser.HttpHeaderFieldNameContext,0)


        def FIELD_COLON(self):
            return self.getToken(APIParser.FIELD_COLON, 0)

        def httpHeaderFieldValue(self):
            return self.getTypedRuleContext(APIParser.HttpHeaderFieldValueContext,0)


        def getRuleIndex(self):
            return APIParser.RULE_httpHeaderField

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




    def httpHeaderField(self):

        localctx = APIParser.HttpHeaderFieldContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_httpHeaderField)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 117
            self.httpHeaderFieldName()
            self.state = 118
            self.match(APIParser.FIELD_COLON)
            self.state = 119
            self.httpHeaderFieldValue()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HttpHeaderFieldNameContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def HttpHeaderFieldName(self):
            return self.getToken(APIParser.HttpHeaderFieldName, 0)

        def getRuleIndex(self):
            return APIParser.RULE_httpHeaderFieldName

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




    def httpHeaderFieldName(self):

        localctx = APIParser.HttpHeaderFieldNameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_httpHeaderFieldName)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 121
            self.match(APIParser.HttpHeaderFieldName)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HttpHeaderFieldValueContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def HttpHeaderFieldValue(self):
            return self.getToken(APIParser.HttpHeaderFieldValue, 0)

        def HttpHeaderFieldValueEnd(self):
            return self.getToken(APIParser.HttpHeaderFieldValueEnd, 0)

        def getRuleIndex(self):
            return APIParser.RULE_httpHeaderFieldValue

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




    def httpHeaderFieldValue(self):

        localctx = APIParser.HttpHeaderFieldValueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_httpHeaderFieldValue)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 123
            self.match(APIParser.HttpHeaderFieldValue)
            self.state = 124
            self.match(APIParser.HttpHeaderFieldValueEnd)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HttpMessageBodyContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def httpMultipart(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(APIParser.HttpMultipartContext)
            else:
                return self.getTypedRuleContext(APIParser.HttpMultipartContext,i)


        def httpMessageBodyContent(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(APIParser.HttpMessageBodyContentContext)
            else:
                return self.getTypedRuleContext(APIParser.HttpMessageBodyContentContext,i)


        def getRuleIndex(self):
            return APIParser.RULE_httpMessageBody

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




    def httpMessageBody(self):

        localctx = APIParser.HttpMessageBodyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_httpMessageBody)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 128 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 128
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [53]:
                    self.state = 126
                    self.httpMultipart()
                    pass
                elif token in [7, 39, 56]:
                    self.state = 127
                    self.httpMessageBodyContent()
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 130 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (((_la) & ~0x3f) == 0 and ((1 << _la) & 81065343048482944) != 0):
                    break

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


    class HttpMultipartContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def HttpMultipartBoundaryEnd(self):
            return self.getToken(APIParser.HttpMultipartBoundaryEnd, 0)

        def httpMultipartBoundary(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(APIParser.HttpMultipartBoundaryContext)
            else:
                return self.getTypedRuleContext(APIParser.HttpMultipartBoundaryContext,i)


        def getRuleIndex(self):
            return APIParser.RULE_httpMultipart

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




    def httpMultipart(self):

        localctx = APIParser.HttpMultipartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_httpMultipart)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 133 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 132
                self.httpMultipartBoundary()
                self.state = 135 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==53):
                    break

            self.state = 137
            self.match(APIParser.HttpMultipartBoundaryEnd)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HttpMultipartBoundaryContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def httpBoundaryDelimiter(self):
            return self.getTypedRuleContext(APIParser.HttpBoundaryDelimiterContext,0)


        def httpHeaderFields(self):
            return self.getTypedRuleContext(APIParser.HttpHeaderFieldsContext,0)


        def httpMessageBodyContent(self):
            return self.getTypedRuleContext(APIParser.HttpMessageBodyContentContext,0)


        def getRuleIndex(self):
            return APIParser.RULE_httpMultipartBoundary

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




    def httpMultipartBoundary(self):

        localctx = APIParser.HttpMultipartBoundaryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_httpMultipartBoundary)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 139
            self.httpBoundaryDelimiter()
            self.state = 140
            self.httpHeaderFields()
            self.state = 141
            self.httpMessageBodyContent()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HttpBoundaryDelimiterContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def HttpMultipartBoundary(self):
            return self.getToken(APIParser.HttpMultipartBoundary, 0)

        def getRuleIndex(self):
            return APIParser.RULE_httpBoundaryDelimiter

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




    def httpBoundaryDelimiter(self):

        localctx = APIParser.HttpBoundaryDelimiterContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_httpBoundaryDelimiter)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 143
            self.match(APIParser.HttpMultipartBoundary)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HttpMessageBodyContentContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def httpMessageBodyOperate(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(APIParser.HttpMessageBodyOperateContext)
            else:
                return self.getTypedRuleContext(APIParser.HttpMessageBodyOperateContext,i)


        def httpMessageBodyOther(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(APIParser.HttpMessageBodyOtherContext)
            else:
                return self.getTypedRuleContext(APIParser.HttpMessageBodyOtherContext,i)


        def getRuleIndex(self):
            return APIParser.RULE_httpMessageBodyContent

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




    def httpMessageBodyContent(self):

        localctx = APIParser.HttpMessageBodyContentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_httpMessageBodyContent)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 147 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 147
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [56]:
                        self.state = 145
                        self.httpMessageBodyOperate()
                        pass
                    elif token in [7, 39]:
                        self.state = 146
                        self.httpMessageBodyOther()
                        pass
                    else:
                        raise NoViableAltException(self)


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

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


    class HttpMessageBodyOperateContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def HttpMessageBodyOperate(self):
            return self.getToken(APIParser.HttpMessageBodyOperate, 0)

        def getRuleIndex(self):
            return APIParser.RULE_httpMessageBodyOperate

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




    def httpMessageBodyOperate(self):

        localctx = APIParser.HttpMessageBodyOperateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_httpMessageBodyOperate)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 151
            self.match(APIParser.HttpMessageBodyOperate)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HttpMessageBodyOtherContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def getRuleIndex(self):
            return APIParser.RULE_httpMessageBodyOther

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




    def httpMessageBodyOther(self):

        localctx = APIParser.HttpMessageBodyOtherContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_httpMessageBodyOther)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 154 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 153
                    _la = self._input.LA(1)
                    if not(_la==7 or _la==39):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()

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

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


    class BaseCommandContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def assert_(self):
            return self.getTypedRuleContext(APIParser.AssertContext,0)


        def load(self):
            return self.getTypedRuleContext(APIParser.LoadContext,0)


        def host(self):
            return self.getTypedRuleContext(APIParser.HostContext,0)


        def start(self):
            return self.getTypedRuleContext(APIParser.StartContext,0)


        def loop(self):
            return self.getTypedRuleContext(APIParser.LoopContext,0)


        def if_(self):
            return self.getTypedRuleContext(APIParser.IfContext,0)


        def endif(self):
            return self.getTypedRuleContext(APIParser.EndifContext,0)


        def whenever(self):
            return self.getTypedRuleContext(APIParser.WheneverContext,0)


        def set_(self):
            return self.getTypedRuleContext(APIParser.SetContext,0)


        def use(self):
            return self.getTypedRuleContext(APIParser.UseContext,0)


        def exit(self):
            return self.getTypedRuleContext(APIParser.ExitContext,0)


        def quit(self):
            return self.getTypedRuleContext(APIParser.QuitContext,0)


        def sleep(self):
            return self.getTypedRuleContext(APIParser.SleepContext,0)


        def spool(self):
            return self.getTypedRuleContext(APIParser.SpoolContext,0)


        def script(self):
            return self.getTypedRuleContext(APIParser.ScriptContext,0)


        def echo(self):
            return self.getTypedRuleContext(APIParser.EchoContext,0)


        def getRuleIndex(self):
            return APIParser.RULE_baseCommand

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




    def baseCommand(self):

        localctx = APIParser.BaseCommandContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_baseCommand)
        try:
            self.state = 174
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [28]:
                self.enterOuterAlt(localctx, 1)
                self.state = 158
                self.assert_()
                pass
            elif token in [30]:
                self.enterOuterAlt(localctx, 2)
                self.state = 159
                self.load()
                pass
            elif token in [31]:
                self.enterOuterAlt(localctx, 3)
                self.state = 160
                self.host()
                pass
            elif token in [29]:
                self.enterOuterAlt(localctx, 4)
                self.state = 161
                self.start()
                pass
            elif token in [35]:
                self.enterOuterAlt(localctx, 5)
                self.state = 162
                self.loop()
                pass
            elif token in [32]:
                self.enterOuterAlt(localctx, 6)
                self.state = 163
                self.if_()
                pass
            elif token in [33]:
                self.enterOuterAlt(localctx, 7)
                self.state = 164
                self.endif()
                pass
            elif token in [36]:
                self.enterOuterAlt(localctx, 8)
                self.state = 165
                self.whenever()
                pass
            elif token in [34]:
                self.enterOuterAlt(localctx, 9)
                self.state = 166
                self.set_()
                pass
            elif token in [26]:
                self.enterOuterAlt(localctx, 10)
                self.state = 167
                self.use()
                pass
            elif token in [22]:
                self.enterOuterAlt(localctx, 11)
                self.state = 168
                self.exit()
                pass
            elif token in [23]:
                self.enterOuterAlt(localctx, 12)
                self.state = 169
                self.quit()
                pass
            elif token in [25]:
                self.enterOuterAlt(localctx, 13)
                self.state = 170
                self.sleep()
                pass
            elif token in [24]:
                self.enterOuterAlt(localctx, 14)
                self.state = 171
                self.spool()
                pass
            elif token in [2]:
                self.enterOuterAlt(localctx, 15)
                self.state = 172
                self.script()
                pass
            elif token in [27]:
                self.enterOuterAlt(localctx, 16)
                self.state = 173
                self.echo()
                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 ExitContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def EXIT(self):
            return self.getToken(APIParser.EXIT, 0)

        def INT(self):
            return self.getToken(APIParser.INT, 0)

        def SEMICOLON(self):
            return self.getToken(APIParser.SEMICOLON, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_exit

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




    def exit(self):

        localctx = APIParser.ExitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_exit)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 176
            self.match(APIParser.EXIT)
            self.state = 178
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==37:
                self.state = 177
                self.match(APIParser.INT)


            self.state = 181
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==9:
                self.state = 180
                self.match(APIParser.SEMICOLON)


            self.state = 184
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 183
                self.match(APIParser.CRLF)


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


    class QuitContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def QUIT(self):
            return self.getToken(APIParser.QUIT, 0)

        def INT(self):
            return self.getToken(APIParser.INT, 0)

        def SEMICOLON(self):
            return self.getToken(APIParser.SEMICOLON, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_quit

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




    def quit(self):

        localctx = APIParser.QuitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_quit)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 186
            self.match(APIParser.QUIT)
            self.state = 188
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==37:
                self.state = 187
                self.match(APIParser.INT)


            self.state = 191
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==9:
                self.state = 190
                self.match(APIParser.SEMICOLON)


            self.state = 194
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 193
                self.match(APIParser.CRLF)


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


    class UseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def USE(self):
            return self.getToken(APIParser.USE, 0)

        def USE_API(self):
            return self.getToken(APIParser.USE_API, 0)

        def USE_SQL(self):
            return self.getToken(APIParser.USE_SQL, 0)

        def USE_SEMICOLON(self):
            return self.getToken(APIParser.USE_SEMICOLON, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_use

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




    def use(self):

        localctx = APIParser.UseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_use)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 196
            self.match(APIParser.USE)
            self.state = 197
            _la = self._input.LA(1)
            if not(_la==102 or _la==103):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 199
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==105:
                self.state = 198
                self.match(APIParser.USE_SEMICOLON)


            self.state = 202
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 201
                self.match(APIParser.CRLF)


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


    class SleepContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def SLEEP(self):
            return self.getToken(APIParser.SLEEP, 0)

        def INT(self):
            return self.getToken(APIParser.INT, 0)

        def SEMICOLON(self):
            return self.getToken(APIParser.SEMICOLON, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_sleep

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




    def sleep(self):

        localctx = APIParser.SleepContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_sleep)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 204
            self.match(APIParser.SLEEP)
            self.state = 205
            self.match(APIParser.INT)
            self.state = 207
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==9:
                self.state = 206
                self.match(APIParser.SEMICOLON)


            self.state = 210
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 209
                self.match(APIParser.CRLF)


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


    class StartContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def START(self):
            return self.getToken(APIParser.START, 0)

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

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

        def START_LOOP(self):
            return self.getToken(APIParser.START_LOOP, 0)

        def START_INT(self):
            return self.getToken(APIParser.START_INT, 0)

        def SEMICOLON(self):
            return self.getToken(APIParser.SEMICOLON, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_start

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




    def start(self):

        localctx = APIParser.StartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_start)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 212
            self.match(APIParser.START)
            self.state = 213
            self.match(APIParser.START_EXPRESSION)
            self.state = 218
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==70:
                self.state = 214
                self.match(APIParser.START_COMMA)
                self.state = 215
                self.match(APIParser.START_EXPRESSION)
                self.state = 220
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 222
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==68:
                self.state = 221
                self.match(APIParser.START_LOOP)


            self.state = 225
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==69:
                self.state = 224
                self.match(APIParser.START_INT)


            self.state = 228
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==9:
                self.state = 227
                self.match(APIParser.SEMICOLON)


            self.state = 231
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 230
                self.match(APIParser.CRLF)


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


    class LoadContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def LOAD(self):
            return self.getToken(APIParser.LOAD, 0)

        def LOAD_OPTION(self):
            return self.getToken(APIParser.LOAD_OPTION, 0)

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

        def SEMICOLON(self):
            return self.getToken(APIParser.SEMICOLON, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_load

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




    def load(self):

        localctx = APIParser.LoadContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_load)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 233
            self.match(APIParser.LOAD)
            self.state = 234
            self.match(APIParser.LOAD_OPTION)
            self.state = 236 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 235
                self.match(APIParser.LOAD_EXPRESSION)
                self.state = 238 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==65):
                    break

            self.state = 241
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==9:
                self.state = 240
                self.match(APIParser.SEMICOLON)


            self.state = 244
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 243
                self.match(APIParser.CRLF)


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


    class AssertContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def ASSERT(self):
            return self.getToken(APIParser.ASSERT, 0)

        def ASSERT_EXPRESSION(self):
            return self.getToken(APIParser.ASSERT_EXPRESSION, 0)

        def SEMICOLON(self):
            return self.getToken(APIParser.SEMICOLON, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_assert

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




    def assert_(self):

        localctx = APIParser.AssertContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_assert)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 246
            self.match(APIParser.ASSERT)
            self.state = 247
            self.match(APIParser.ASSERT_EXPRESSION)
            self.state = 249
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==9:
                self.state = 248
                self.match(APIParser.SEMICOLON)


            self.state = 252
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 251
                self.match(APIParser.CRLF)


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


    class HostContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def HOST(self):
            return self.getToken(APIParser.HOST, 0)

        def HOST_BLOCK(self):
            return self.getToken(APIParser.HOST_BLOCK, 0)

        def getRuleIndex(self):
            return APIParser.RULE_host

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




    def host(self):

        localctx = APIParser.HostContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_host)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 254
            self.match(APIParser.HOST)
            self.state = 255
            self.match(APIParser.HOST_BLOCK)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LoopContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def LOOP(self):
            return self.getToken(APIParser.LOOP, 0)

        def LOOP_BREAK(self):
            return self.getToken(APIParser.LOOP_BREAK, 0)

        def LOOP_END(self):
            return self.getToken(APIParser.LOOP_END, 0)

        def LOOP_CONTINUE(self):
            return self.getToken(APIParser.LOOP_CONTINUE, 0)

        def LOOP_BEGIN(self):
            return self.getToken(APIParser.LOOP_BEGIN, 0)

        def LOOP_UNTIL(self):
            return self.getToken(APIParser.LOOP_UNTIL, 0)

        def LOOP_EXPRESSION(self):
            return self.getToken(APIParser.LOOP_EXPRESSION, 0)

        def LOOP_SEMICOLON(self):
            return self.getToken(APIParser.LOOP_SEMICOLON, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_loop

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




    def loop(self):

        localctx = APIParser.LoopContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_loop)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 257
            self.match(APIParser.LOOP)
            self.state = 264
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [86]:
                self.state = 258
                self.match(APIParser.LOOP_BREAK)
                pass
            elif token in [87]:
                self.state = 259
                self.match(APIParser.LOOP_END)
                pass
            elif token in [88]:
                self.state = 260
                self.match(APIParser.LOOP_CONTINUE)
                pass
            elif token in [82]:
                self.state = 261
                self.match(APIParser.LOOP_BEGIN)
                self.state = 262
                self.match(APIParser.LOOP_UNTIL)
                self.state = 263
                self.match(APIParser.LOOP_EXPRESSION)
                pass
            else:
                raise NoViableAltException(self)

            self.state = 267
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==80:
                self.state = 266
                self.match(APIParser.LOOP_SEMICOLON)


            self.state = 270
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 269
                self.match(APIParser.CRLF)


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


    class IfContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def IF(self):
            return self.getToken(APIParser.IF, 0)

        def IF_EXPRESSION(self):
            return self.getToken(APIParser.IF_EXPRESSION, 0)

        def SEMICOLON(self):
            return self.getToken(APIParser.SEMICOLON, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_if

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




    def if_(self):

        localctx = APIParser.IfContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_if)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 272
            self.match(APIParser.IF)
            self.state = 273
            self.match(APIParser.IF_EXPRESSION)
            self.state = 275
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==9:
                self.state = 274
                self.match(APIParser.SEMICOLON)


            self.state = 278
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 277
                self.match(APIParser.CRLF)


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


    class EndifContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def ENDIF(self):
            return self.getToken(APIParser.ENDIF, 0)

        def SEMICOLON(self):
            return self.getToken(APIParser.SEMICOLON, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_endif

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




    def endif(self):

        localctx = APIParser.EndifContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_endif)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 280
            self.match(APIParser.ENDIF)
            self.state = 282
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==9:
                self.state = 281
                self.match(APIParser.SEMICOLON)


            self.state = 285
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 284
                self.match(APIParser.CRLF)


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


    class WheneverContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def WHENEVER(self):
            return self.getToken(APIParser.WHENEVER, 0)

        def WHENEVER_ERROR(self):
            return self.getToken(APIParser.WHENEVER_ERROR, 0)

        def WHENEVER_CONTINUE(self):
            return self.getToken(APIParser.WHENEVER_CONTINUE, 0)

        def WHENEVER_EXIT(self):
            return self.getToken(APIParser.WHENEVER_EXIT, 0)

        def WHENEVER_SEMICOLON(self):
            return self.getToken(APIParser.WHENEVER_SEMICOLON, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_whenever

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




    def whenever(self):

        localctx = APIParser.WheneverContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_whenever)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 287
            self.match(APIParser.WHENEVER)
            self.state = 288
            self.match(APIParser.WHENEVER_ERROR)
            self.state = 289
            _la = self._input.LA(1)
            if not(_la==94 or _la==95):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 291
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==93:
                self.state = 290
                self.match(APIParser.WHENEVER_SEMICOLON)


            self.state = 294
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 293
                self.match(APIParser.CRLF)


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


    class SpoolContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def SPOOL(self):
            return self.getToken(APIParser.SPOOL, 0)

        def String(self):
            return self.getToken(APIParser.String, 0)

        def SEMICOLON(self):
            return self.getToken(APIParser.SEMICOLON, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_spool

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




    def spool(self):

        localctx = APIParser.SpoolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_spool)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 296
            self.match(APIParser.SPOOL)
            self.state = 297
            self.match(APIParser.String)
            self.state = 299
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==9:
                self.state = 298
                self.match(APIParser.SEMICOLON)


            self.state = 302
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 301
                self.match(APIParser.CRLF)


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


    class EchoContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def ECHO_OPEN(self):
            return self.getToken(APIParser.ECHO_OPEN, 0)

        def EchoBlock(self):
            return self.getToken(APIParser.EchoBlock, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def EOF(self):
            return self.getToken(APIParser.EOF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_echo

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




    def echo(self):

        localctx = APIParser.EchoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_echo)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 304
            self.match(APIParser.ECHO_OPEN)
            self.state = 305
            self.match(APIParser.EchoBlock)
            self.state = 307
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,43,self._ctx)
            if la_ == 1:
                self.state = 306
                _la = self._input.LA(1)
                if not(_la==-1 or _la==7):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


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


    class ScriptContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def SCRIPT_OPEN(self):
            return self.getToken(APIParser.SCRIPT_OPEN, 0)

        def ScriptBlock(self):
            return self.getToken(APIParser.ScriptBlock, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_script

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




    def script(self):

        localctx = APIParser.ScriptContext(self, self._ctx, self.state)
        self.enterRule(localctx, 70, self.RULE_script)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 309
            self.match(APIParser.SCRIPT_OPEN)
            self.state = 310
            self.match(APIParser.ScriptBlock)
            self.state = 312
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 311
                self.match(APIParser.CRLF)


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


    class SetContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def SET(self):
            return self.getToken(APIParser.SET, 0)

        def SET_AT(self):
            return self.getToken(APIParser.SET_AT, 0)

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

        def SET_SEMICOLON(self):
            return self.getToken(APIParser.SET_SEMICOLON, 0)

        def CRLF(self):
            return self.getToken(APIParser.CRLF, 0)

        def getRuleIndex(self):
            return APIParser.RULE_set

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




    def set_(self):

        localctx = APIParser.SetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 72, self.RULE_set)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 314
            self.match(APIParser.SET)
            self.state = 316
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==100:
                self.state = 315
                self.match(APIParser.SET_AT)


            self.state = 321
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==98:
                self.state = 318
                self.match(APIParser.SET_EXPRESSION)
                self.state = 323
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 325
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==99:
                self.state = 324
                self.match(APIParser.SET_SEMICOLON)


            self.state = 328
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 327
                self.match(APIParser.CRLF)


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





