# Generated from visualg.g4 by ANTLR 4.9.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():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3P")
        buf.write("\u022a\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
        buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16")
        buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23")
        buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31")
        buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36")
        buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\3\2\3\2\3\2")
        buf.write("\7\2L\n\2\f\2\16\2O\13\2\3\2\5\2R\n\2\3\2\3\2\3\2\3\2")
        buf.write("\3\2\7\2Y\n\2\f\2\16\2\\\13\2\3\2\3\2\7\2`\n\2\f\2\16")
        buf.write("\2c\13\2\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\7\3n\n\3")
        buf.write("\f\3\16\3q\13\3\3\4\3\4\3\4\3\4\7\4w\n\4\f\4\16\4z\13")
        buf.write("\4\3\5\3\5\3\5\5\5\177\n\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5")
        buf.write("\3\5\3\5\7\5\u008a\n\5\f\5\16\5\u008d\13\5\3\5\3\5\3\5")
        buf.write("\7\5\u0092\n\5\f\5\16\5\u0095\13\5\3\5\3\5\3\5\3\5\6\5")
        buf.write("\u009b\n\5\r\5\16\5\u009c\3\5\5\5\u00a0\n\5\3\5\3\5\3")
        buf.write("\6\3\6\5\6\u00a6\n\6\3\6\3\6\3\6\3\6\3\6\5\6\u00ad\n\6")
        buf.write("\3\6\3\6\3\6\3\6\7\6\u00b3\n\6\f\6\16\6\u00b6\13\6\3\6")
        buf.write("\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3")
        buf.write("\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\5\7\u00cf\n\7\3\b\3")
        buf.write("\b\3\b\3\b\3\b\6\b\u00d6\n\b\r\b\16\b\u00d7\3\b\3\b\3")
        buf.write("\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\f")
        buf.write("\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\5\r\u00f1\n\r\3\r\3\r")
        buf.write("\3\r\3\r\3\r\5\r\u00f8\n\r\7\r\u00fa\n\r\f\r\16\r\u00fd")
        buf.write("\13\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17")
        buf.write("\3\17\7\17\u010a\n\17\f\17\16\17\u010d\13\17\3\17\3\17")
        buf.write("\7\17\u0111\n\17\f\17\16\17\u0114\13\17\5\17\u0116\n\17")
        buf.write("\3\17\3\17\3\20\3\20\3\20\3\20\3\20\7\20\u011f\n\20\f")
        buf.write("\20\16\20\u0122\13\20\6\20\u0124\n\20\r\20\16\20\u0125")
        buf.write("\3\20\3\20\7\20\u012a\n\20\f\20\16\20\u012d\13\20\5\20")
        buf.write("\u012f\n\20\3\20\3\20\3\21\3\21\3\21\3\21\6\21\u0137\n")
        buf.write("\21\r\21\16\21\u0138\3\21\3\21\6\21\u013d\n\21\r\21\16")
        buf.write("\21\u013e\3\21\3\21\5\21\u0143\n\21\3\21\3\21\7\21\u0147")
        buf.write("\n\21\f\21\16\21\u014a\13\21\3\21\3\21\3\22\3\22\3\22")
        buf.write("\3\22\7\22\u0152\n\22\f\22\16\22\u0155\13\22\3\22\3\22")
        buf.write("\3\23\3\23\7\23\u015b\n\23\f\23\16\23\u015e\13\23\3\23")
        buf.write("\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\7\24")
        buf.write("\u016b\n\24\f\24\16\24\u016e\13\24\3\24\5\24\u0171\n\24")
        buf.write("\3\24\5\24\u0174\n\24\3\25\3\25\3\25\3\26\3\26\3\26\3")
        buf.write("\26\3\26\3\26\3\26\3\26\7\26\u0181\n\26\f\26\16\26\u0184")
        buf.write("\13\26\5\26\u0186\n\26\3\27\3\27\3\27\7\27\u018b\n\27")
        buf.write("\f\27\16\27\u018e\13\27\3\30\3\30\5\30\u0192\n\30\3\30")
        buf.write("\3\30\3\30\5\30\u0197\n\30\7\30\u0199\n\30\f\30\16\30")
        buf.write("\u019c\13\30\3\31\3\31\3\31\3\31\3\32\3\32\5\32\u01a4")
        buf.write("\n\32\3\33\3\33\3\33\3\33\3\33\3\34\6\34\u01ac\n\34\r")
        buf.write("\34\16\34\u01ad\3\34\3\34\6\34\u01b2\n\34\r\34\16\34\u01b3")
        buf.write("\3\34\3\34\6\34\u01b8\n\34\r\34\16\34\u01b9\3\34\3\34")
        buf.write("\7\34\u01be\n\34\f\34\16\34\u01c1\13\34\3\35\3\35\3\35")
        buf.write("\6\35\u01c6\n\35\r\35\16\35\u01c7\3\35\3\35\6\35\u01cc")
        buf.write("\n\35\r\35\16\35\u01cd\5\35\u01d0\n\35\3\36\3\36\3\36")
        buf.write("\5\36\u01d5\n\36\3\37\5\37\u01d8\n\37\3\37\5\37\u01db")
        buf.write("\n\37\3\37\3\37\3\37\5\37\u01e0\n\37\3\37\5\37\u01e3\n")
        buf.write("\37\3\37\3\37\5\37\u01e7\n\37\7\37\u01e9\n\37\f\37\16")
        buf.write("\37\u01ec\13\37\3\37\5\37\u01ef\n\37\3 \5 \u01f2\n \3")
        buf.write(" \5 \u01f5\n \3 \3 \3 \5 \u01fa\n \3 \5 \u01fd\n \3 \3")
        buf.write(" \5 \u0201\n \3 \3 \3 \3 \5 \u0207\n \3 \5 \u020a\n \3")
        buf.write(" \3 \5 \u020e\n \5 \u0210\n \7 \u0212\n \f \16 \u0215")
        buf.write("\13 \5 \u0217\n \3 \5 \u021a\n \3!\3!\3\"\3\"\3#\3#\3")
        buf.write("$\5$\u0223\n$\3$\6$\u0226\n$\r$\16$\u0227\3$\2\2%\2\4")
        buf.write("\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64")
        buf.write("\668:<>@BDF\2\13\3\2\32\33\4\2\25\25\31\31\4\2\3\3$$\3")
        buf.write("\2\3\t\3\2\n\17\3\2\20\23\5\2\36\36&\'NN\4\2&(NN\4\2\34")
        buf.write("\34&(\2\u0274\2H\3\2\2\2\4h\3\2\2\2\6x\3\2\2\2\b{\3\2")
        buf.write("\2\2\n\u00a3\3\2\2\2\f\u00ce\3\2\2\2\16\u00d0\3\2\2\2")
        buf.write("\20\u00db\3\2\2\2\22\u00df\3\2\2\2\24\u00e3\3\2\2\2\26")
        buf.write("\u00e7\3\2\2\2\30\u00eb\3\2\2\2\32\u0100\3\2\2\2\34\u0105")
        buf.write("\3\2\2\2\36\u0119\3\2\2\2 \u0132\3\2\2\2\"\u014d\3\2\2")
        buf.write("\2$\u0158\3\2\2\2&\u0162\3\2\2\2(\u0175\3\2\2\2*\u0178")
        buf.write("\3\2\2\2,\u0187\3\2\2\2.\u0191\3\2\2\2\60\u019d\3\2\2")
        buf.write("\2\62\u01a3\3\2\2\2\64\u01a5\3\2\2\2\66\u01ab\3\2\2\2")
        buf.write("8\u01c2\3\2\2\2:\u01d4\3\2\2\2<\u01d7\3\2\2\2>\u01f1\3")
        buf.write("\2\2\2@\u021b\3\2\2\2B\u021d\3\2\2\2D\u021f\3\2\2\2F\u0222")
        buf.write("\3\2\2\2HI\7\30\2\2IM\7\34\2\2JL\t\2\2\2KJ\3\2\2\2LO\3")
        buf.write("\2\2\2MK\3\2\2\2MN\3\2\2\2NQ\3\2\2\2OM\3\2\2\2PR\5\4\3")
        buf.write("\2QP\3\2\2\2QR\3\2\2\2RZ\3\2\2\2SY\5\20\t\2TY\5\22\n\2")
        buf.write("UY\5\24\13\2VY\5\26\f\2WY\5\b\5\2XS\3\2\2\2XT\3\2\2\2")
        buf.write("XU\3\2\2\2XV\3\2\2\2XW\3\2\2\2Y\\\3\2\2\2ZX\3\2\2\2Z[")
        buf.write("\3\2\2\2[]\3\2\2\2\\Z\3\2\2\2]a\7\26\2\2^`\5\f\7\2_^\3")
        buf.write("\2\2\2`c\3\2\2\2a_\3\2\2\2ab\3\2\2\2bd\3\2\2\2ca\3\2\2")
        buf.write("\2de\7\27\2\2ef\3\2\2\2fg\7\2\2\3g\3\3\2\2\2ho\7?\2\2")
        buf.write("ij\5,\27\2jk\7H\2\2kl\5\62\32\2ln\3\2\2\2mi\3\2\2\2nq")
        buf.write("\3\2\2\2om\3\2\2\2op\3\2\2\2p\5\3\2\2\2qo\3\2\2\2rs\5")
        buf.write(",\27\2st\7H\2\2tu\5\62\32\2uw\3\2\2\2vr\3\2\2\2wz\3\2")
        buf.write("\2\2xv\3\2\2\2xy\3\2\2\2y\7\3\2\2\2zx\3\2\2\2{|\7M\2\2")
        buf.write("|~\7N\2\2}\177\5\n\6\2~}\3\2\2\2~\177\3\2\2\2\177\u0080")
        buf.write("\3\2\2\2\u0080\u0081\7H\2\2\u0081\u008b\t\3\2\2\u0082")
        buf.write("\u008a\7\32\2\2\u0083\u008a\7\33\2\2\u0084\u008a\5\20")
        buf.write("\t\2\u0085\u008a\5\22\n\2\u0086\u008a\5\24\13\2\u0087")
        buf.write("\u008a\5\26\f\2\u0088\u008a\5\4\3\2\u0089\u0082\3\2\2")
        buf.write("\2\u0089\u0083\3\2\2\2\u0089\u0084\3\2\2\2\u0089\u0085")
        buf.write("\3\2\2\2\u0089\u0086\3\2\2\2\u0089\u0087\3\2\2\2\u0089")
        buf.write("\u0088\3\2\2\2\u008a\u008d\3\2\2\2\u008b\u0089\3\2\2\2")
        buf.write("\u008b\u008c\3\2\2\2\u008c\u008e\3\2\2\2\u008d\u008b\3")
        buf.write("\2\2\2\u008e\u008f\5\6\4\2\u008f\u0093\7\26\2\2\u0090")
        buf.write("\u0092\5\f\7\2\u0091\u0090\3\2\2\2\u0092\u0095\3\2\2\2")
        buf.write("\u0093\u0091\3\2\2\2\u0093\u0094\3\2\2\2\u0094\u0096\3")
        buf.write("\2\2\2\u0095\u0093\3\2\2\2\u0096\u009f\7<\2\2\u0097\u009b")
        buf.write("\5:\36\2\u0098\u009b\5,\27\2\u0099\u009b\5\16\b\2\u009a")
        buf.write("\u0097\3\2\2\2\u009a\u0098\3\2\2\2\u009a\u0099\3\2\2\2")
        buf.write("\u009b\u009c\3\2\2\2\u009c\u009a\3\2\2\2\u009c\u009d\3")
        buf.write("\2\2\2\u009d\u00a0\3\2\2\2\u009e\u00a0\7\31\2\2\u009f")
        buf.write("\u009a\3\2\2\2\u009f\u009e\3\2\2\2\u00a0\u00a1\3\2\2\2")
        buf.write("\u00a1\u00a2\7=\2\2\u00a2\t\3\2\2\2\u00a3\u00a5\7\"\2")
        buf.write("\2\u00a4\u00a6\7?\2\2\u00a5\u00a4\3\2\2\2\u00a5\u00a6")
        buf.write("\3\2\2\2\u00a6\u00a7\3\2\2\2\u00a7\u00a8\5,\27\2\u00a8")
        buf.write("\u00a9\7H\2\2\u00a9\u00b4\7\25\2\2\u00aa\u00ac\7>\2\2")
        buf.write("\u00ab\u00ad\7?\2\2\u00ac\u00ab\3\2\2\2\u00ac\u00ad\3")
        buf.write("\2\2\2\u00ad\u00ae\3\2\2\2\u00ae\u00af\5,\27\2\u00af\u00b0")
        buf.write("\7H\2\2\u00b0\u00b1\7\25\2\2\u00b1\u00b3\3\2\2\2\u00b2")
        buf.write("\u00aa\3\2\2\2\u00b3\u00b6\3\2\2\2\u00b4\u00b2\3\2\2\2")
        buf.write("\u00b4\u00b5\3\2\2\2\u00b5\u00b7\3\2\2\2\u00b6\u00b4\3")
        buf.write("\2\2\2\u00b7\u00b8\7#\2\2\u00b8\13\3\2\2\2\u00b9\u00cf")
        buf.write("\5\30\r\2\u00ba\u00cf\5\32\16\2\u00bb\u00cf\5\34\17\2")
        buf.write("\u00bc\u00cf\5\36\20\2\u00bd\u00cf\5 \21\2\u00be\u00cf")
        buf.write("\5\"\22\2\u00bf\u00cf\5$\23\2\u00c0\u00cf\5(\25\2\u00c1")
        buf.write("\u00cf\5&\24\2\u00c2\u00cf\5*\26\2\u00c3\u00cf\7;\2\2")
        buf.write("\u00c4\u00cf\7\32\2\2\u00c5\u00cf\7D\2\2\u00c6\u00cf\7")
        buf.write("E\2\2\u00c7\u00cf\7F\2\2\u00c8\u00cf\7G\2\2\u00c9\u00cf")
        buf.write("\5\16\b\2\u00ca\u00cf\5\20\t\2\u00cb\u00cf\5\22\n\2\u00cc")
        buf.write("\u00cf\5\26\f\2\u00cd\u00cf\5\24\13\2\u00ce\u00b9\3\2")
        buf.write("\2\2\u00ce\u00ba\3\2\2\2\u00ce\u00bb\3\2\2\2\u00ce\u00bc")
        buf.write("\3\2\2\2\u00ce\u00bd\3\2\2\2\u00ce\u00be\3\2\2\2\u00ce")
        buf.write("\u00bf\3\2\2\2\u00ce\u00c0\3\2\2\2\u00ce\u00c1\3\2\2\2")
        buf.write("\u00ce\u00c2\3\2\2\2\u00ce\u00c3\3\2\2\2\u00ce\u00c4\3")
        buf.write("\2\2\2\u00ce\u00c5\3\2\2\2\u00ce\u00c6\3\2\2\2\u00ce\u00c7")
        buf.write("\3\2\2\2\u00ce\u00c8\3\2\2\2\u00ce\u00c9\3\2\2\2\u00ce")
        buf.write("\u00ca\3\2\2\2\u00ce\u00cb\3\2\2\2\u00ce\u00cc\3\2\2\2")
        buf.write("\u00ce\u00cd\3\2\2\2\u00cf\r\3\2\2\2\u00d0\u00d1\7N\2")
        buf.write("\2\u00d1\u00d5\7\"\2\2\u00d2\u00d6\5.\30\2\u00d3\u00d6")
        buf.write("\5,\27\2\u00d4\u00d6\5\16\b\2\u00d5\u00d2\3\2\2\2\u00d5")
        buf.write("\u00d3\3\2\2\2\u00d5\u00d4\3\2\2\2\u00d6\u00d7\3\2\2\2")
        buf.write("\u00d7\u00d5\3\2\2\2\u00d7\u00d8\3\2\2\2\u00d8\u00d9\3")
        buf.write("\2\2\2\u00d9\u00da\7#\2\2\u00da\17\3\2\2\2\u00db\u00dc")
        buf.write("\7N\2\2\u00dc\u00dd\7%\2\2\u00dd\u00de\7\34\2\2\u00de")
        buf.write("\21\3\2\2\2\u00df\u00e0\7N\2\2\u00e0\u00e1\7%\2\2\u00e1")
        buf.write("\u00e2\5:\36\2\u00e2\23\3\2\2\2\u00e3\u00e4\7N\2\2\u00e4")
        buf.write("\u00e5\7%\2\2\u00e5\u00e6\7(\2\2\u00e6\25\3\2\2\2\u00e7")
        buf.write("\u00e8\7\36\2\2\u00e8\u00e9\7%\2\2\u00e9\u00ea\5:\36\2")
        buf.write("\u00ea\27\3\2\2\2\u00eb\u00ec\7*\2\2\u00ec\u00f0\7\"\2")
        buf.write("\2\u00ed\u00f1\7\34\2\2\u00ee\u00f1\5:\36\2\u00ef\u00f1")
        buf.write("\58\35\2\u00f0\u00ed\3\2\2\2\u00f0\u00ee\3\2\2\2\u00f0")
        buf.write("\u00ef\3\2\2\2\u00f1\u00fb\3\2\2\2\u00f2\u00f7\t\4\2\2")
        buf.write("\u00f3\u00f8\7\34\2\2\u00f4\u00f8\5:\36\2\u00f5\u00f8")
        buf.write("\58\35\2\u00f6\u00f8\7N\2\2\u00f7\u00f3\3\2\2\2\u00f7")
        buf.write("\u00f4\3\2\2\2\u00f7\u00f5\3\2\2\2\u00f7\u00f6\3\2\2\2")
        buf.write("\u00f8\u00fa\3\2\2\2\u00f9\u00f2\3\2\2\2\u00fa\u00fd\3")
        buf.write("\2\2\2\u00fb\u00f9\3\2\2\2\u00fb\u00fc\3\2\2\2\u00fc\u00fe")
        buf.write("\3\2\2\2\u00fd\u00fb\3\2\2\2\u00fe\u00ff\7#\2\2\u00ff")
        buf.write("\31\3\2\2\2\u0100\u0101\7+\2\2\u0101\u0102\7\"\2\2\u0102")
        buf.write("\u0103\5,\27\2\u0103\u0104\7#\2\2\u0104\33\3\2\2\2\u0105")
        buf.write("\u0106\7,\2\2\u0106\u0107\5> \2\u0107\u010b\7-\2\2\u0108")
        buf.write("\u010a\5\f\7\2\u0109\u0108\3\2\2\2\u010a\u010d\3\2\2\2")
        buf.write("\u010b\u0109\3\2\2\2\u010b\u010c\3\2\2\2\u010c\u0115\3")
        buf.write("\2\2\2\u010d\u010b\3\2\2\2\u010e\u0112\7.\2\2\u010f\u0111")
        buf.write("\5\f\7\2\u0110\u010f\3\2\2\2\u0111\u0114\3\2\2\2\u0112")
        buf.write("\u0110\3\2\2\2\u0112\u0113\3\2\2\2\u0113\u0116\3\2\2\2")
        buf.write("\u0114\u0112\3\2\2\2\u0115\u010e\3\2\2\2\u0115\u0116\3")
        buf.write("\2\2\2\u0116\u0117\3\2\2\2\u0117\u0118\7/\2\2\u0118\35")
        buf.write("\3\2\2\2\u0119\u011a\7\60\2\2\u011a\u0123\7N\2\2\u011b")
        buf.write("\u011c\7\61\2\2\u011c\u0120\5D#\2\u011d\u011f\5\f\7\2")
        buf.write("\u011e\u011d\3\2\2\2\u011f\u0122\3\2\2\2\u0120\u011e\3")
        buf.write("\2\2\2\u0120\u0121\3\2\2\2\u0121\u0124\3\2\2\2\u0122\u0120")
        buf.write("\3\2\2\2\u0123\u011b\3\2\2\2\u0124\u0125\3\2\2\2\u0125")
        buf.write("\u0123\3\2\2\2\u0125\u0126\3\2\2\2\u0126\u012e\3\2\2\2")
        buf.write("\u0127\u012b\7\62\2\2\u0128\u012a\5\f\7\2\u0129\u0128")
        buf.write("\3\2\2\2\u012a\u012d\3\2\2\2\u012b\u0129\3\2\2\2\u012b")
        buf.write("\u012c\3\2\2\2\u012c\u012f\3\2\2\2\u012d\u012b\3\2\2\2")
        buf.write("\u012e\u0127\3\2\2\2\u012e\u012f\3\2\2\2\u012f\u0130\3")
        buf.write("\2\2\2\u0130\u0131\7\63\2\2\u0131\37\3\2\2\2\u0132\u0133")
        buf.write("\7\64\2\2\u0133\u0134\7N\2\2\u0134\u0136\7\37\2\2\u0135")
        buf.write("\u0137\7&\2\2\u0136\u0135\3\2\2\2\u0137\u0138\3\2\2\2")
        buf.write("\u0138\u0136\3\2\2\2\u0138\u0139\3\2\2\2\u0139\u013a\3")
        buf.write("\2\2\2\u013a\u013c\7\65\2\2\u013b\u013d\7&\2\2\u013c\u013b")
        buf.write("\3\2\2\2\u013d\u013e\3\2\2\2\u013e\u013c\3\2\2\2\u013e")
        buf.write("\u013f\3\2\2\2\u013f\u0142\3\2\2\2\u0140\u0141\7K\2\2")
        buf.write("\u0141\u0143\5F$\2\u0142\u0140\3\2\2\2\u0142\u0143\3\2")
        buf.write("\2\2\u0143\u0144\3\2\2\2\u0144\u0148\7\66\2\2\u0145\u0147")
        buf.write("\5\f\7\2\u0146\u0145\3\2\2\2\u0147\u014a\3\2\2\2\u0148")
        buf.write("\u0146\3\2\2\2\u0148\u0149\3\2\2\2\u0149\u014b\3\2\2\2")
        buf.write("\u014a\u0148\3\2\2\2\u014b\u014c\7\67\2\2\u014c!\3\2\2")
        buf.write("\2\u014d\u014e\79\2\2\u014e\u014f\5> \2\u014f\u0153\7")
        buf.write("\66\2\2\u0150\u0152\5\f\7\2\u0151\u0150\3\2\2\2\u0152")
        buf.write("\u0155\3\2\2\2\u0153\u0151\3\2\2\2\u0153\u0154\3\2\2\2")
        buf.write("\u0154\u0156\3\2\2\2\u0155\u0153\3\2\2\2\u0156\u0157\7")
        buf.write(":\2\2\u0157#\3\2\2\2\u0158\u015c\78\2\2\u0159\u015b\5")
        buf.write("\f\7\2\u015a\u0159\3\2\2\2\u015b\u015e\3\2\2\2\u015c\u015a")
        buf.write("\3\2\2\2\u015c\u015d\3\2\2\2\u015d\u015f\3\2\2\2\u015e")
        buf.write("\u015c\3\2\2\2\u015f\u0160\7\65\2\2\u0160\u0161\5> \2")
        buf.write("\u0161%\3\2\2\2\u0162\u0173\7I\2\2\u0163\u0164\7 \2\2")
        buf.write("\u0164\u0165\7@\2\2\u0165\u0174\7!\2\2\u0166\u0167\7 ")
        buf.write("\2\2\u0167\u0168\7A\2\2\u0168\u0174\7!\2\2\u0169\u016b")
        buf.write("\7&\2\2\u016a\u0169\3\2\2\2\u016b\u016e\3\2\2\2\u016c")
        buf.write("\u016a\3\2\2\2\u016c\u016d\3\2\2\2\u016d\u0170\3\2\2\2")
        buf.write("\u016e\u016c\3\2\2\2\u016f\u0171\7$\2\2\u0170\u016f\3")
        buf.write("\2\2\2\u0170\u0171\3\2\2\2\u0171\u0172\3\2\2\2\u0172\u0174")
        buf.write("\7&\2\2\u0173\u0163\3\2\2\2\u0173\u0166\3\2\2\2\u0173")
        buf.write("\u016c\3\2\2\2\u0174\'\3\2\2\2\u0175\u0176\7B\2\2\u0176")
        buf.write("\u0177\7C\2\2\u0177)\3\2\2\2\u0178\u0185\7J\2\2\u0179")
        buf.write("\u017a\7 \2\2\u017a\u017b\7@\2\2\u017b\u0186\7!\2\2\u017c")
        buf.write("\u017d\7 \2\2\u017d\u017e\7A\2\2\u017e\u0186\7!\2\2\u017f")
        buf.write("\u0181\7&\2\2\u0180\u017f\3\2\2\2\u0181\u0184\3\2\2\2")
        buf.write("\u0182\u0180\3\2\2\2\u0182\u0183\3\2\2\2\u0183\u0186\3")
        buf.write("\2\2\2\u0184\u0182\3\2\2\2\u0185\u0179\3\2\2\2\u0185\u017c")
        buf.write("\3\2\2\2\u0185\u0182\3\2\2\2\u0186+\3\2\2\2\u0187\u018c")
        buf.write("\7N\2\2\u0188\u0189\7$\2\2\u0189\u018b\7N\2\2\u018a\u0188")
        buf.write("\3\2\2\2\u018b\u018e\3\2\2\2\u018c\u018a\3\2\2\2\u018c")
        buf.write("\u018d\3\2\2\2\u018d-\3\2\2\2\u018e\u018c\3\2\2\2\u018f")
        buf.write("\u0192\5@!\2\u0190\u0192\7(\2\2\u0191\u018f\3\2\2\2\u0191")
        buf.write("\u0190\3\2\2\2\u0192\u019a\3\2\2\2\u0193\u0196\7$\2\2")
        buf.write("\u0194\u0197\5@!\2\u0195\u0197\7(\2\2\u0196\u0194\3\2")
        buf.write("\2\2\u0196\u0195\3\2\2\2\u0197\u0199\3\2\2\2\u0198\u0193")
        buf.write("\3\2\2\2\u0199\u019c\3\2\2\2\u019a\u0198\3\2\2\2\u019a")
        buf.write("\u019b\3\2\2\2\u019b/\3\2\2\2\u019c\u019a\3\2\2\2\u019d")
        buf.write("\u019e\7 \2\2\u019e\u019f\5\66\34\2\u019f\u01a0\7!\2\2")
        buf.write("\u01a0\61\3\2\2\2\u01a1\u01a4\7\25\2\2\u01a2\u01a4\5\64")
        buf.write("\33\2\u01a3\u01a1\3\2\2\2\u01a3\u01a2\3\2\2\2\u01a4\63")
        buf.write("\3\2\2\2\u01a5\u01a6\7\35\2\2\u01a6\u01a7\5\60\31\2\u01a7")
        buf.write("\u01a8\7\37\2\2\u01a8\u01a9\7\25\2\2\u01a9\65\3\2\2\2")
        buf.write("\u01aa\u01ac\7&\2\2\u01ab\u01aa\3\2\2\2\u01ac\u01ad\3")
        buf.write("\2\2\2\u01ad\u01ab\3\2\2\2\u01ad\u01ae\3\2\2\2\u01ae\u01af")
        buf.write("\3\2\2\2\u01af\u01b1\7)\2\2\u01b0\u01b2\7&\2\2\u01b1\u01b0")
        buf.write("\3\2\2\2\u01b2\u01b3\3\2\2\2\u01b3\u01b1\3\2\2\2\u01b3")
        buf.write("\u01b4\3\2\2\2\u01b4\u01bf\3\2\2\2\u01b5\u01b7\7$\2\2")
        buf.write("\u01b6\u01b8\7&\2\2\u01b7\u01b6\3\2\2\2\u01b8\u01b9\3")
        buf.write("\2\2\2\u01b9\u01b7\3\2\2\2\u01b9\u01ba\3\2\2\2\u01ba\u01bb")
        buf.write("\3\2\2\2\u01bb\u01bc\7)\2\2\u01bc\u01be\7&\2\2\u01bd\u01b5")
        buf.write("\3\2\2\2\u01be\u01c1\3\2\2\2\u01bf\u01bd\3\2\2\2\u01bf")
        buf.write("\u01c0\3\2\2\2\u01c0\67\3\2\2\2\u01c1\u01bf\3\2\2\2\u01c2")
        buf.write("\u01c3\5:\36\2\u01c3\u01c5\7H\2\2\u01c4\u01c6\7&\2\2\u01c5")
        buf.write("\u01c4\3\2\2\2\u01c6\u01c7\3\2\2\2\u01c7\u01c5\3\2\2\2")
        buf.write("\u01c7\u01c8\3\2\2\2\u01c8\u01cf\3\2\2\2\u01c9\u01cb\7")
        buf.write("H\2\2\u01ca\u01cc\7&\2\2\u01cb\u01ca\3\2\2\2\u01cc\u01cd")
        buf.write("\3\2\2\2\u01cd\u01cb\3\2\2\2\u01cd\u01ce\3\2\2\2\u01ce")
        buf.write("\u01d0\3\2\2\2\u01cf\u01c9\3\2\2\2\u01cf\u01d0\3\2\2\2")
        buf.write("\u01d09\3\2\2\2\u01d1\u01d5\5<\37\2\u01d2\u01d5\5> \2")
        buf.write("\u01d3\u01d5\5\16\b\2\u01d4\u01d1\3\2\2\2\u01d4\u01d2")
        buf.write("\3\2\2\2\u01d4\u01d3\3\2\2\2\u01d5;\3\2\2\2\u01d6\u01d8")
        buf.write("\7\"\2\2\u01d7\u01d6\3\2\2\2\u01d7\u01d8\3\2\2\2\u01d8")
        buf.write("\u01da\3\2\2\2\u01d9\u01db\7\24\2\2\u01da\u01d9\3\2\2")
        buf.write("\2\u01da\u01db\3\2\2\2\u01db\u01dc\3\2\2\2\u01dc\u01ea")
        buf.write("\5@!\2\u01dd\u01df\t\5\2\2\u01de\u01e0\7\"\2\2\u01df\u01de")
        buf.write("\3\2\2\2\u01df\u01e0\3\2\2\2\u01e0\u01e2\3\2\2\2\u01e1")
        buf.write("\u01e3\7\24\2\2\u01e2\u01e1\3\2\2\2\u01e2\u01e3\3\2\2")
        buf.write("\2\u01e3\u01e4\3\2\2\2\u01e4\u01e6\5@!\2\u01e5\u01e7\7")
        buf.write("#\2\2\u01e6\u01e5\3\2\2\2\u01e6\u01e7\3\2\2\2\u01e7\u01e9")
        buf.write("\3\2\2\2\u01e8\u01dd\3\2\2\2\u01e9\u01ec\3\2\2\2\u01ea")
        buf.write("\u01e8\3\2\2\2\u01ea\u01eb\3\2\2\2\u01eb\u01ee\3\2\2\2")
        buf.write("\u01ec\u01ea\3\2\2\2\u01ed\u01ef\7#\2\2\u01ee\u01ed\3")
        buf.write("\2\2\2\u01ee\u01ef\3\2\2\2\u01ef=\3\2\2\2\u01f0\u01f2")
        buf.write("\7\"\2\2\u01f1\u01f0\3\2\2\2\u01f1\u01f2\3\2\2\2\u01f2")
        buf.write("\u01f4\3\2\2\2\u01f3\u01f5\7\24\2\2\u01f4\u01f3\3\2\2")
        buf.write("\2\u01f4\u01f5\3\2\2\2\u01f5\u01f6\3\2\2\2\u01f6\u0216")
        buf.write("\5B\"\2\u01f7\u01f9\t\6\2\2\u01f8\u01fa\7\"\2\2\u01f9")
        buf.write("\u01f8\3\2\2\2\u01f9\u01fa\3\2\2\2\u01fa\u01fc\3\2\2\2")
        buf.write("\u01fb\u01fd\7\24\2\2\u01fc\u01fb\3\2\2\2\u01fc\u01fd")
        buf.write("\3\2\2\2\u01fd\u01fe\3\2\2\2\u01fe\u0200\5B\"\2\u01ff")
        buf.write("\u0201\7#\2\2\u0200\u01ff\3\2\2\2\u0200\u0201\3\2\2\2")
        buf.write("\u0201\u0213\3\2\2\2\u0202\u0203\t\7\2\2\u0203\u020f\5")
        buf.write("B\"\2\u0204\u0206\t\6\2\2\u0205\u0207\7\"\2\2\u0206\u0205")
        buf.write("\3\2\2\2\u0206\u0207\3\2\2\2\u0207\u0209\3\2\2\2\u0208")
        buf.write("\u020a\7\24\2\2\u0209\u0208\3\2\2\2\u0209\u020a\3\2\2")
        buf.write("\2\u020a\u020b\3\2\2\2\u020b\u020d\5B\"\2\u020c\u020e")
        buf.write("\7#\2\2\u020d\u020c\3\2\2\2\u020d\u020e\3\2\2\2\u020e")
        buf.write("\u0210\3\2\2\2\u020f\u0204\3\2\2\2\u020f\u0210\3\2\2\2")
        buf.write("\u0210\u0212\3\2\2\2\u0211\u0202\3\2\2\2\u0212\u0215\3")
        buf.write("\2\2\2\u0213\u0211\3\2\2\2\u0213\u0214\3\2\2\2\u0214\u0217")
        buf.write("\3\2\2\2\u0215\u0213\3\2\2\2\u0216\u01f7\3\2\2\2\u0216")
        buf.write("\u0217\3\2\2\2\u0217\u0219\3\2\2\2\u0218\u021a\7#\2\2")
        buf.write("\u0219\u0218\3\2\2\2\u0219\u021a\3\2\2\2\u021a?\3\2\2")
        buf.write("\2\u021b\u021c\t\b\2\2\u021cA\3\2\2\2\u021d\u021e\t\t")
        buf.write("\2\2\u021eC\3\2\2\2\u021f\u0220\t\n\2\2\u0220E\3\2\2\2")
        buf.write("\u0221\u0223\7\4\2\2\u0222\u0221\3\2\2\2\u0222\u0223\3")
        buf.write("\2\2\2\u0223\u0225\3\2\2\2\u0224\u0226\7&\2\2\u0225\u0224")
        buf.write("\3\2\2\2\u0226\u0227\3\2\2\2\u0227\u0225\3\2\2\2\u0227")
        buf.write("\u0228\3\2\2\2\u0228G\3\2\2\2MMQXZaox~\u0089\u008b\u0093")
        buf.write("\u009a\u009c\u009f\u00a5\u00ac\u00b4\u00ce\u00d5\u00d7")
        buf.write("\u00f0\u00f7\u00fb\u010b\u0112\u0115\u0120\u0125\u012b")
        buf.write("\u012e\u0138\u013e\u0142\u0148\u0153\u015c\u016c\u0170")
        buf.write("\u0173\u0182\u0185\u018c\u0191\u0196\u019a\u01a3\u01ad")
        buf.write("\u01b3\u01b9\u01bf\u01c7\u01cd\u01cf\u01d4\u01d7\u01da")
        buf.write("\u01df\u01e2\u01e6\u01ea\u01ee\u01f1\u01f4\u01f9\u01fc")
        buf.write("\u0200\u0206\u0209\u020d\u020f\u0213\u0216\u0219\u0222")
        buf.write("\u0227")
        return buf.getvalue()


class visualgParser ( Parser ):

    grammarFileName = "visualg.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'+'", "'-'", "'*'", "'/'", "'mod'", "'^'", 
                     "'\\'", "'>'", "'>='", "'<'", "'<='", "'='", "'<>'", 
                     "'nao'", "'ou'", "'e'", "'xou'", "<INVALID>", "<INVALID>", 
                     "'inicio'", "'fimalgoritmo'", "'algoritmo'", "'void'", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "'vetor'", "<INVALID>", 
                     "'de'", "'['", "']'", "'('", "')'", "','", "'<-'", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "'..'", "<INVALID>", 
                     "'leia'", "'se'", "'entao'", "'senao'", "'fimse'", 
                     "'escolha'", "'caso'", "'outrocaso'", "'fimescolha'", 
                     "'para'", "'ate'", "'faca'", "'fimpara'", "'repita'", 
                     "'enquanto'", "'fimenquanto'", "'interrompa'", "'retorne'", 
                     "'fimfuncao'", "';'", "'var'", "'on'", "'off'", "'arquivo'", 
                     "<INVALID>", "'pausa'", "<INVALID>", "<INVALID>", "'limpatela'", 
                     "':'", "'aleatorio'", "'timer'", "'passo'", "'//'", 
                     "'funcao '" ]

    symbolicNames = [ "<INVALID>", "OP_SOM", "OP_SUB", "OP_MUL", "OP_DIV", 
                      "OP_RES", "OP_POT", "OP_DIV_INT", "OP_MAIOR", "OP_MAIOR_IGUAL", 
                      "OP_MENOR", "OP_MENOR_IGUAL", "OP_IGUAL", "OP_DIFERENTE", 
                      "OP_NAO", "OP_OU", "OP_E", "OP_XOU", "OPERADOR_UNARIO", 
                      "TIPO_DE_DADO", "INICIO", "FIM_ALGORITMO", "ALGORITMO", 
                      "VOID", "COMENTARIO", "COMENTARIO_MULTILINHA", "STRING", 
                      "VETOR", "MATRIZ", "DE", "ABRE_COLCHETES", "FECHA_COLCHETES", 
                      "ABRE_PARENTESES", "FECHA_PARENTESES", "VIRGULA", 
                      "ATRIBUIR", "INTEIRO", "REAL", "BOOL", "PONTO_PONTO", 
                      "ESCREVA", "LEIA", "SE", "ENTAO", "SENAO", "FIM_SE", 
                      "ESCOLHA", "CASO", "OUTRO_CASO", "FIM_ESCOLHA", "PARA", 
                      "ATE", "FACA", "FIM_PARA", "REPITA", "ENQUANTO", "FIM_ENQUANTO", 
                      "INTERROMPA", "RETORNO", "FIM_FUNCAO", "PONTO_VIRGULA", 
                      "VAR", "ON", "OFF", "ARQUIVO", "NOME_ARQUIVO", "PAUSA", 
                      "ECO", "CRONOMETRO", "LIMPATELA", "DOIS_PONTOS", "ALEATORIO", 
                      "TIMER", "PASSO", "BARRA_BARRA", "DECLARACAO_FUNCAO", 
                      "VARIAVEL", "WS", "ENTER" ]

    RULE_prog = 0
    RULE_variaveis_globais = 1
    RULE_variaveis_locais = 2
    RULE_funcoes = 3
    RULE_parametros = 4
    RULE_expressoes = 5
    RULE_chamar_funcao = 6
    RULE_constCaractere = 7
    RULE_constNumerico = 8
    RULE_constBool = 9
    RULE_constVet = 10
    RULE_escreva = 11
    RULE_leia = 12
    RULE_desvio_condicional = 13
    RULE_selecao_multipla = 14
    RULE_para_faca = 15
    RULE_enquanto_faca = 16
    RULE_repita_ate = 17
    RULE_aleatorio = 18
    RULE_arquivo = 19
    RULE_timer = 20
    RULE_lista_de_variaveis = 21
    RULE_lista_numeros = 22
    RULE_lista_de_intervalo = 23
    RULE_tipo_da_variavel = 24
    RULE_tipo_vetor = 25
    RULE_intervalo = 26
    RULE_print_variavel = 27
    RULE_calculo = 28
    RULE_expressao_aritmetica = 29
    RULE_expressao_logica = 30
    RULE_selecao_aritmetica = 31
    RULE_selecao_logica = 32
    RULE_selecao_escolha = 33
    RULE_incremento = 34

    ruleNames =  [ "prog", "variaveis_globais", "variaveis_locais", "funcoes", 
                   "parametros", "expressoes", "chamar_funcao", "constCaractere", 
                   "constNumerico", "constBool", "constVet", "escreva", 
                   "leia", "desvio_condicional", "selecao_multipla", "para_faca", 
                   "enquanto_faca", "repita_ate", "aleatorio", "arquivo", 
                   "timer", "lista_de_variaveis", "lista_numeros", "lista_de_intervalo", 
                   "tipo_da_variavel", "tipo_vetor", "intervalo", "print_variavel", 
                   "calculo", "expressao_aritmetica", "expressao_logica", 
                   "selecao_aritmetica", "selecao_logica", "selecao_escolha", 
                   "incremento" ]

    EOF = Token.EOF
    OP_SOM=1
    OP_SUB=2
    OP_MUL=3
    OP_DIV=4
    OP_RES=5
    OP_POT=6
    OP_DIV_INT=7
    OP_MAIOR=8
    OP_MAIOR_IGUAL=9
    OP_MENOR=10
    OP_MENOR_IGUAL=11
    OP_IGUAL=12
    OP_DIFERENTE=13
    OP_NAO=14
    OP_OU=15
    OP_E=16
    OP_XOU=17
    OPERADOR_UNARIO=18
    TIPO_DE_DADO=19
    INICIO=20
    FIM_ALGORITMO=21
    ALGORITMO=22
    VOID=23
    COMENTARIO=24
    COMENTARIO_MULTILINHA=25
    STRING=26
    VETOR=27
    MATRIZ=28
    DE=29
    ABRE_COLCHETES=30
    FECHA_COLCHETES=31
    ABRE_PARENTESES=32
    FECHA_PARENTESES=33
    VIRGULA=34
    ATRIBUIR=35
    INTEIRO=36
    REAL=37
    BOOL=38
    PONTO_PONTO=39
    ESCREVA=40
    LEIA=41
    SE=42
    ENTAO=43
    SENAO=44
    FIM_SE=45
    ESCOLHA=46
    CASO=47
    OUTRO_CASO=48
    FIM_ESCOLHA=49
    PARA=50
    ATE=51
    FACA=52
    FIM_PARA=53
    REPITA=54
    ENQUANTO=55
    FIM_ENQUANTO=56
    INTERROMPA=57
    RETORNO=58
    FIM_FUNCAO=59
    PONTO_VIRGULA=60
    VAR=61
    ON=62
    OFF=63
    ARQUIVO=64
    NOME_ARQUIVO=65
    PAUSA=66
    ECO=67
    CRONOMETRO=68
    LIMPATELA=69
    DOIS_PONTOS=70
    ALEATORIO=71
    TIMER=72
    PASSO=73
    BARRA_BARRA=74
    DECLARACAO_FUNCAO=75
    VARIAVEL=76
    WS=77
    ENTER=78

    def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
        super().__init__(input, output)
        self.checkVersion("4.9.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 EOF(self):
            return self.getToken(visualgParser.EOF, 0)

        def ALGORITMO(self):
            return self.getToken(visualgParser.ALGORITMO, 0)

        def STRING(self):
            return self.getToken(visualgParser.STRING, 0)

        def INICIO(self):
            return self.getToken(visualgParser.INICIO, 0)

        def FIM_ALGORITMO(self):
            return self.getToken(visualgParser.FIM_ALGORITMO, 0)

        def variaveis_globais(self):
            return self.getTypedRuleContext(visualgParser.Variaveis_globaisContext,0)


        def constCaractere(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ConstCaractereContext)
            else:
                return self.getTypedRuleContext(visualgParser.ConstCaractereContext,i)


        def constNumerico(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ConstNumericoContext)
            else:
                return self.getTypedRuleContext(visualgParser.ConstNumericoContext,i)


        def constBool(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ConstBoolContext)
            else:
                return self.getTypedRuleContext(visualgParser.ConstBoolContext,i)


        def constVet(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ConstVetContext)
            else:
                return self.getTypedRuleContext(visualgParser.ConstVetContext,i)


        def funcoes(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.FuncoesContext)
            else:
                return self.getTypedRuleContext(visualgParser.FuncoesContext,i)


        def expressoes(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ExpressoesContext)
            else:
                return self.getTypedRuleContext(visualgParser.ExpressoesContext,i)


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

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

        def getRuleIndex(self):
            return visualgParser.RULE_prog

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

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




    def prog(self):

        localctx = visualgParser.ProgContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_prog)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 70
            self.match(visualgParser.ALGORITMO)
            self.state = 71
            self.match(visualgParser.STRING)
            self.state = 75
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==visualgParser.COMENTARIO or _la==visualgParser.COMENTARIO_MULTILINHA:
                self.state = 72
                _la = self._input.LA(1)
                if not(_la==visualgParser.COMENTARIO or _la==visualgParser.COMENTARIO_MULTILINHA):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 77
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 79
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==visualgParser.VAR:
                self.state = 78
                self.variaveis_globais()


            self.state = 88
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 28)) & ~0x3f) == 0 and ((1 << (_la - 28)) & ((1 << (visualgParser.MATRIZ - 28)) | (1 << (visualgParser.DECLARACAO_FUNCAO - 28)) | (1 << (visualgParser.VARIAVEL - 28)))) != 0):
                self.state = 86
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,2,self._ctx)
                if la_ == 1:
                    self.state = 81
                    self.constCaractere()
                    pass

                elif la_ == 2:
                    self.state = 82
                    self.constNumerico()
                    pass

                elif la_ == 3:
                    self.state = 83
                    self.constBool()
                    pass

                elif la_ == 4:
                    self.state = 84
                    self.constVet()
                    pass

                elif la_ == 5:
                    self.state = 85
                    self.funcoes()
                    pass


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

            self.state = 91
            self.match(visualgParser.INICIO)
            self.state = 95
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 24)) & ~0x3f) == 0 and ((1 << (_la - 24)) & ((1 << (visualgParser.COMENTARIO - 24)) | (1 << (visualgParser.MATRIZ - 24)) | (1 << (visualgParser.ESCREVA - 24)) | (1 << (visualgParser.LEIA - 24)) | (1 << (visualgParser.SE - 24)) | (1 << (visualgParser.ESCOLHA - 24)) | (1 << (visualgParser.PARA - 24)) | (1 << (visualgParser.REPITA - 24)) | (1 << (visualgParser.ENQUANTO - 24)) | (1 << (visualgParser.INTERROMPA - 24)) | (1 << (visualgParser.ARQUIVO - 24)) | (1 << (visualgParser.PAUSA - 24)) | (1 << (visualgParser.ECO - 24)) | (1 << (visualgParser.CRONOMETRO - 24)) | (1 << (visualgParser.LIMPATELA - 24)) | (1 << (visualgParser.ALEATORIO - 24)) | (1 << (visualgParser.TIMER - 24)) | (1 << (visualgParser.VARIAVEL - 24)))) != 0):
                self.state = 92
                self.expressoes()
                self.state = 97
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 98
            self.match(visualgParser.FIM_ALGORITMO)
            self.state = 100
            self.match(visualgParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Variaveis_globaisContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def VAR(self):
            return self.getToken(visualgParser.VAR, 0)

        def lista_de_variaveis(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Lista_de_variaveisContext)
            else:
                return self.getTypedRuleContext(visualgParser.Lista_de_variaveisContext,i)


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

        def tipo_da_variavel(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Tipo_da_variavelContext)
            else:
                return self.getTypedRuleContext(visualgParser.Tipo_da_variavelContext,i)


        def getRuleIndex(self):
            return visualgParser.RULE_variaveis_globais

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

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




    def variaveis_globais(self):

        localctx = visualgParser.Variaveis_globaisContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_variaveis_globais)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 102
            self.match(visualgParser.VAR)
            self.state = 109
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,5,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 103
                    self.lista_de_variaveis()
                    self.state = 104
                    self.match(visualgParser.DOIS_PONTOS)
                    self.state = 105
                    self.tipo_da_variavel() 
                self.state = 111
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,5,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 Variaveis_locaisContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def lista_de_variaveis(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Lista_de_variaveisContext)
            else:
                return self.getTypedRuleContext(visualgParser.Lista_de_variaveisContext,i)


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

        def tipo_da_variavel(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Tipo_da_variavelContext)
            else:
                return self.getTypedRuleContext(visualgParser.Tipo_da_variavelContext,i)


        def getRuleIndex(self):
            return visualgParser.RULE_variaveis_locais

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

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




    def variaveis_locais(self):

        localctx = visualgParser.Variaveis_locaisContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_variaveis_locais)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 118
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==visualgParser.VARIAVEL:
                self.state = 112
                self.lista_de_variaveis()
                self.state = 113
                self.match(visualgParser.DOIS_PONTOS)
                self.state = 114
                self.tipo_da_variavel()
                self.state = 120
                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 FuncoesContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def DECLARACAO_FUNCAO(self):
            return self.getToken(visualgParser.DECLARACAO_FUNCAO, 0)

        def VARIAVEL(self):
            return self.getToken(visualgParser.VARIAVEL, 0)

        def DOIS_PONTOS(self):
            return self.getToken(visualgParser.DOIS_PONTOS, 0)

        def variaveis_locais(self):
            return self.getTypedRuleContext(visualgParser.Variaveis_locaisContext,0)


        def INICIO(self):
            return self.getToken(visualgParser.INICIO, 0)

        def RETORNO(self):
            return self.getToken(visualgParser.RETORNO, 0)

        def FIM_FUNCAO(self):
            return self.getToken(visualgParser.FIM_FUNCAO, 0)

        def TIPO_DE_DADO(self):
            return self.getToken(visualgParser.TIPO_DE_DADO, 0)

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

        def parametros(self):
            return self.getTypedRuleContext(visualgParser.ParametrosContext,0)


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

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

        def constCaractere(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ConstCaractereContext)
            else:
                return self.getTypedRuleContext(visualgParser.ConstCaractereContext,i)


        def constNumerico(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ConstNumericoContext)
            else:
                return self.getTypedRuleContext(visualgParser.ConstNumericoContext,i)


        def constBool(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ConstBoolContext)
            else:
                return self.getTypedRuleContext(visualgParser.ConstBoolContext,i)


        def constVet(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ConstVetContext)
            else:
                return self.getTypedRuleContext(visualgParser.ConstVetContext,i)


        def variaveis_globais(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Variaveis_globaisContext)
            else:
                return self.getTypedRuleContext(visualgParser.Variaveis_globaisContext,i)


        def expressoes(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ExpressoesContext)
            else:
                return self.getTypedRuleContext(visualgParser.ExpressoesContext,i)


        def calculo(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.CalculoContext)
            else:
                return self.getTypedRuleContext(visualgParser.CalculoContext,i)


        def lista_de_variaveis(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Lista_de_variaveisContext)
            else:
                return self.getTypedRuleContext(visualgParser.Lista_de_variaveisContext,i)


        def chamar_funcao(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Chamar_funcaoContext)
            else:
                return self.getTypedRuleContext(visualgParser.Chamar_funcaoContext,i)


        def getRuleIndex(self):
            return visualgParser.RULE_funcoes

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

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




    def funcoes(self):

        localctx = visualgParser.FuncoesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_funcoes)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 121
            self.match(visualgParser.DECLARACAO_FUNCAO)
            self.state = 122
            self.match(visualgParser.VARIAVEL)
            self.state = 124
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==visualgParser.ABRE_PARENTESES:
                self.state = 123
                self.parametros()


            self.state = 126
            self.match(visualgParser.DOIS_PONTOS)
            self.state = 127
            _la = self._input.LA(1)
            if not(_la==visualgParser.TIPO_DE_DADO or _la==visualgParser.VOID):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 137
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,9,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 135
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,8,self._ctx)
                    if la_ == 1:
                        self.state = 128
                        self.match(visualgParser.COMENTARIO)
                        pass

                    elif la_ == 2:
                        self.state = 129
                        self.match(visualgParser.COMENTARIO_MULTILINHA)
                        pass

                    elif la_ == 3:
                        self.state = 130
                        self.constCaractere()
                        pass

                    elif la_ == 4:
                        self.state = 131
                        self.constNumerico()
                        pass

                    elif la_ == 5:
                        self.state = 132
                        self.constBool()
                        pass

                    elif la_ == 6:
                        self.state = 133
                        self.constVet()
                        pass

                    elif la_ == 7:
                        self.state = 134
                        self.variaveis_globais()
                        pass

             
                self.state = 139
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,9,self._ctx)

            self.state = 140
            self.variaveis_locais()
            self.state = 141
            self.match(visualgParser.INICIO)
            self.state = 145
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 24)) & ~0x3f) == 0 and ((1 << (_la - 24)) & ((1 << (visualgParser.COMENTARIO - 24)) | (1 << (visualgParser.MATRIZ - 24)) | (1 << (visualgParser.ESCREVA - 24)) | (1 << (visualgParser.LEIA - 24)) | (1 << (visualgParser.SE - 24)) | (1 << (visualgParser.ESCOLHA - 24)) | (1 << (visualgParser.PARA - 24)) | (1 << (visualgParser.REPITA - 24)) | (1 << (visualgParser.ENQUANTO - 24)) | (1 << (visualgParser.INTERROMPA - 24)) | (1 << (visualgParser.ARQUIVO - 24)) | (1 << (visualgParser.PAUSA - 24)) | (1 << (visualgParser.ECO - 24)) | (1 << (visualgParser.CRONOMETRO - 24)) | (1 << (visualgParser.LIMPATELA - 24)) | (1 << (visualgParser.ALEATORIO - 24)) | (1 << (visualgParser.TIMER - 24)) | (1 << (visualgParser.VARIAVEL - 24)))) != 0):
                self.state = 142
                self.expressoes()
                self.state = 147
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 148
            self.match(visualgParser.RETORNO)
            self.state = 157
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [visualgParser.OPERADOR_UNARIO, visualgParser.MATRIZ, visualgParser.ABRE_PARENTESES, visualgParser.INTEIRO, visualgParser.REAL, visualgParser.BOOL, visualgParser.VARIAVEL]:
                self.state = 152 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 152
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,11,self._ctx)
                    if la_ == 1:
                        self.state = 149
                        self.calculo()
                        pass

                    elif la_ == 2:
                        self.state = 150
                        self.lista_de_variaveis()
                        pass

                    elif la_ == 3:
                        self.state = 151
                        self.chamar_funcao()
                        pass


                    self.state = 154 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not (((((_la - 18)) & ~0x3f) == 0 and ((1 << (_la - 18)) & ((1 << (visualgParser.OPERADOR_UNARIO - 18)) | (1 << (visualgParser.MATRIZ - 18)) | (1 << (visualgParser.ABRE_PARENTESES - 18)) | (1 << (visualgParser.INTEIRO - 18)) | (1 << (visualgParser.REAL - 18)) | (1 << (visualgParser.BOOL - 18)) | (1 << (visualgParser.VARIAVEL - 18)))) != 0)):
                        break

                pass
            elif token in [visualgParser.VOID]:
                self.state = 156
                self.match(visualgParser.VOID)
                pass
            else:
                raise NoViableAltException(self)

            self.state = 159
            self.match(visualgParser.FIM_FUNCAO)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ParametrosContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def ABRE_PARENTESES(self):
            return self.getToken(visualgParser.ABRE_PARENTESES, 0)

        def lista_de_variaveis(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Lista_de_variaveisContext)
            else:
                return self.getTypedRuleContext(visualgParser.Lista_de_variaveisContext,i)


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

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

        def FECHA_PARENTESES(self):
            return self.getToken(visualgParser.FECHA_PARENTESES, 0)

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

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

        def getRuleIndex(self):
            return visualgParser.RULE_parametros

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

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




    def parametros(self):

        localctx = visualgParser.ParametrosContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_parametros)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 161
            self.match(visualgParser.ABRE_PARENTESES)
            self.state = 163
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==visualgParser.VAR:
                self.state = 162
                self.match(visualgParser.VAR)


            self.state = 165
            self.lista_de_variaveis()
            self.state = 166
            self.match(visualgParser.DOIS_PONTOS)
            self.state = 167
            self.match(visualgParser.TIPO_DE_DADO)
            self.state = 178
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==visualgParser.PONTO_VIRGULA:
                self.state = 168
                self.match(visualgParser.PONTO_VIRGULA)
                self.state = 170
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==visualgParser.VAR:
                    self.state = 169
                    self.match(visualgParser.VAR)


                self.state = 172
                self.lista_de_variaveis()
                self.state = 173
                self.match(visualgParser.DOIS_PONTOS)
                self.state = 174
                self.match(visualgParser.TIPO_DE_DADO)
                self.state = 180
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 181
            self.match(visualgParser.FECHA_PARENTESES)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ExpressoesContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def escreva(self):
            return self.getTypedRuleContext(visualgParser.EscrevaContext,0)


        def leia(self):
            return self.getTypedRuleContext(visualgParser.LeiaContext,0)


        def desvio_condicional(self):
            return self.getTypedRuleContext(visualgParser.Desvio_condicionalContext,0)


        def selecao_multipla(self):
            return self.getTypedRuleContext(visualgParser.Selecao_multiplaContext,0)


        def para_faca(self):
            return self.getTypedRuleContext(visualgParser.Para_facaContext,0)


        def enquanto_faca(self):
            return self.getTypedRuleContext(visualgParser.Enquanto_facaContext,0)


        def repita_ate(self):
            return self.getTypedRuleContext(visualgParser.Repita_ateContext,0)


        def arquivo(self):
            return self.getTypedRuleContext(visualgParser.ArquivoContext,0)


        def aleatorio(self):
            return self.getTypedRuleContext(visualgParser.AleatorioContext,0)


        def timer(self):
            return self.getTypedRuleContext(visualgParser.TimerContext,0)


        def INTERROMPA(self):
            return self.getToken(visualgParser.INTERROMPA, 0)

        def COMENTARIO(self):
            return self.getToken(visualgParser.COMENTARIO, 0)

        def PAUSA(self):
            return self.getToken(visualgParser.PAUSA, 0)

        def ECO(self):
            return self.getToken(visualgParser.ECO, 0)

        def CRONOMETRO(self):
            return self.getToken(visualgParser.CRONOMETRO, 0)

        def LIMPATELA(self):
            return self.getToken(visualgParser.LIMPATELA, 0)

        def chamar_funcao(self):
            return self.getTypedRuleContext(visualgParser.Chamar_funcaoContext,0)


        def constCaractere(self):
            return self.getTypedRuleContext(visualgParser.ConstCaractereContext,0)


        def constNumerico(self):
            return self.getTypedRuleContext(visualgParser.ConstNumericoContext,0)


        def constVet(self):
            return self.getTypedRuleContext(visualgParser.ConstVetContext,0)


        def constBool(self):
            return self.getTypedRuleContext(visualgParser.ConstBoolContext,0)


        def getRuleIndex(self):
            return visualgParser.RULE_expressoes

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

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




    def expressoes(self):

        localctx = visualgParser.ExpressoesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_expressoes)
        try:
            self.state = 204
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,17,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 183
                self.escreva()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 184
                self.leia()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 185
                self.desvio_condicional()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 186
                self.selecao_multipla()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 187
                self.para_faca()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 188
                self.enquanto_faca()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 189
                self.repita_ate()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 190
                self.arquivo()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 191
                self.aleatorio()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 192
                self.timer()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 193
                self.match(visualgParser.INTERROMPA)
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 194
                self.match(visualgParser.COMENTARIO)
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 195
                self.match(visualgParser.PAUSA)
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 196
                self.match(visualgParser.ECO)
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 197
                self.match(visualgParser.CRONOMETRO)
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 198
                self.match(visualgParser.LIMPATELA)
                pass

            elif la_ == 17:
                self.enterOuterAlt(localctx, 17)
                self.state = 199
                self.chamar_funcao()
                pass

            elif la_ == 18:
                self.enterOuterAlt(localctx, 18)
                self.state = 200
                self.constCaractere()
                pass

            elif la_ == 19:
                self.enterOuterAlt(localctx, 19)
                self.state = 201
                self.constNumerico()
                pass

            elif la_ == 20:
                self.enterOuterAlt(localctx, 20)
                self.state = 202
                self.constVet()
                pass

            elif la_ == 21:
                self.enterOuterAlt(localctx, 21)
                self.state = 203
                self.constBool()
                pass


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


    class Chamar_funcaoContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def VARIAVEL(self):
            return self.getToken(visualgParser.VARIAVEL, 0)

        def ABRE_PARENTESES(self):
            return self.getToken(visualgParser.ABRE_PARENTESES, 0)

        def FECHA_PARENTESES(self):
            return self.getToken(visualgParser.FECHA_PARENTESES, 0)

        def lista_numeros(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Lista_numerosContext)
            else:
                return self.getTypedRuleContext(visualgParser.Lista_numerosContext,i)


        def lista_de_variaveis(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Lista_de_variaveisContext)
            else:
                return self.getTypedRuleContext(visualgParser.Lista_de_variaveisContext,i)


        def chamar_funcao(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Chamar_funcaoContext)
            else:
                return self.getTypedRuleContext(visualgParser.Chamar_funcaoContext,i)


        def getRuleIndex(self):
            return visualgParser.RULE_chamar_funcao

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

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




    def chamar_funcao(self):

        localctx = visualgParser.Chamar_funcaoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_chamar_funcao)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 206
            self.match(visualgParser.VARIAVEL)
            self.state = 207
            self.match(visualgParser.ABRE_PARENTESES)
            self.state = 211 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 211
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,18,self._ctx)
                if la_ == 1:
                    self.state = 208
                    self.lista_numeros()
                    pass

                elif la_ == 2:
                    self.state = 209
                    self.lista_de_variaveis()
                    pass

                elif la_ == 3:
                    self.state = 210
                    self.chamar_funcao()
                    pass


                self.state = 213 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (((((_la - 28)) & ~0x3f) == 0 and ((1 << (_la - 28)) & ((1 << (visualgParser.MATRIZ - 28)) | (1 << (visualgParser.INTEIRO - 28)) | (1 << (visualgParser.REAL - 28)) | (1 << (visualgParser.BOOL - 28)) | (1 << (visualgParser.VARIAVEL - 28)))) != 0)):
                    break

            self.state = 215
            self.match(visualgParser.FECHA_PARENTESES)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstCaractereContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def VARIAVEL(self):
            return self.getToken(visualgParser.VARIAVEL, 0)

        def ATRIBUIR(self):
            return self.getToken(visualgParser.ATRIBUIR, 0)

        def STRING(self):
            return self.getToken(visualgParser.STRING, 0)

        def getRuleIndex(self):
            return visualgParser.RULE_constCaractere

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

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




    def constCaractere(self):

        localctx = visualgParser.ConstCaractereContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_constCaractere)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 217
            self.match(visualgParser.VARIAVEL)
            self.state = 218
            self.match(visualgParser.ATRIBUIR)
            self.state = 219
            self.match(visualgParser.STRING)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstNumericoContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def VARIAVEL(self):
            return self.getToken(visualgParser.VARIAVEL, 0)

        def ATRIBUIR(self):
            return self.getToken(visualgParser.ATRIBUIR, 0)

        def calculo(self):
            return self.getTypedRuleContext(visualgParser.CalculoContext,0)


        def getRuleIndex(self):
            return visualgParser.RULE_constNumerico

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

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




    def constNumerico(self):

        localctx = visualgParser.ConstNumericoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_constNumerico)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 221
            self.match(visualgParser.VARIAVEL)
            self.state = 222
            self.match(visualgParser.ATRIBUIR)
            self.state = 223
            self.calculo()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstBoolContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def VARIAVEL(self):
            return self.getToken(visualgParser.VARIAVEL, 0)

        def ATRIBUIR(self):
            return self.getToken(visualgParser.ATRIBUIR, 0)

        def BOOL(self):
            return self.getToken(visualgParser.BOOL, 0)

        def getRuleIndex(self):
            return visualgParser.RULE_constBool

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

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




    def constBool(self):

        localctx = visualgParser.ConstBoolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_constBool)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 225
            self.match(visualgParser.VARIAVEL)
            self.state = 226
            self.match(visualgParser.ATRIBUIR)
            self.state = 227
            self.match(visualgParser.BOOL)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstVetContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def MATRIZ(self):
            return self.getToken(visualgParser.MATRIZ, 0)

        def ATRIBUIR(self):
            return self.getToken(visualgParser.ATRIBUIR, 0)

        def calculo(self):
            return self.getTypedRuleContext(visualgParser.CalculoContext,0)


        def getRuleIndex(self):
            return visualgParser.RULE_constVet

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

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




    def constVet(self):

        localctx = visualgParser.ConstVetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_constVet)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 229
            self.match(visualgParser.MATRIZ)
            self.state = 230
            self.match(visualgParser.ATRIBUIR)
            self.state = 231
            self.calculo()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class EscrevaContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def ESCREVA(self):
            return self.getToken(visualgParser.ESCREVA, 0)

        def ABRE_PARENTESES(self):
            return self.getToken(visualgParser.ABRE_PARENTESES, 0)

        def FECHA_PARENTESES(self):
            return self.getToken(visualgParser.FECHA_PARENTESES, 0)

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

        def calculo(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.CalculoContext)
            else:
                return self.getTypedRuleContext(visualgParser.CalculoContext,i)


        def print_variavel(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Print_variavelContext)
            else:
                return self.getTypedRuleContext(visualgParser.Print_variavelContext,i)


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

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

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

        def getRuleIndex(self):
            return visualgParser.RULE_escreva

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

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




    def escreva(self):

        localctx = visualgParser.EscrevaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_escreva)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 233
            self.match(visualgParser.ESCREVA)
            self.state = 234
            self.match(visualgParser.ABRE_PARENTESES)
            self.state = 238
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,20,self._ctx)
            if la_ == 1:
                self.state = 235
                self.match(visualgParser.STRING)
                pass

            elif la_ == 2:
                self.state = 236
                self.calculo()
                pass

            elif la_ == 3:
                self.state = 237
                self.print_variavel()
                pass


            self.state = 249
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==visualgParser.OP_SOM or _la==visualgParser.VIRGULA:
                self.state = 240
                _la = self._input.LA(1)
                if not(_la==visualgParser.OP_SOM or _la==visualgParser.VIRGULA):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 245
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,21,self._ctx)
                if la_ == 1:
                    self.state = 241
                    self.match(visualgParser.STRING)
                    pass

                elif la_ == 2:
                    self.state = 242
                    self.calculo()
                    pass

                elif la_ == 3:
                    self.state = 243
                    self.print_variavel()
                    pass

                elif la_ == 4:
                    self.state = 244
                    self.match(visualgParser.VARIAVEL)
                    pass


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

            self.state = 252
            self.match(visualgParser.FECHA_PARENTESES)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LeiaContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def LEIA(self):
            return self.getToken(visualgParser.LEIA, 0)

        def ABRE_PARENTESES(self):
            return self.getToken(visualgParser.ABRE_PARENTESES, 0)

        def lista_de_variaveis(self):
            return self.getTypedRuleContext(visualgParser.Lista_de_variaveisContext,0)


        def FECHA_PARENTESES(self):
            return self.getToken(visualgParser.FECHA_PARENTESES, 0)

        def getRuleIndex(self):
            return visualgParser.RULE_leia

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

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




    def leia(self):

        localctx = visualgParser.LeiaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_leia)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 254
            self.match(visualgParser.LEIA)
            self.state = 255
            self.match(visualgParser.ABRE_PARENTESES)
            self.state = 256
            self.lista_de_variaveis()
            self.state = 257
            self.match(visualgParser.FECHA_PARENTESES)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Desvio_condicionalContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def SE(self):
            return self.getToken(visualgParser.SE, 0)

        def expressao_logica(self):
            return self.getTypedRuleContext(visualgParser.Expressao_logicaContext,0)


        def ENTAO(self):
            return self.getToken(visualgParser.ENTAO, 0)

        def FIM_SE(self):
            return self.getToken(visualgParser.FIM_SE, 0)

        def expressoes(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ExpressoesContext)
            else:
                return self.getTypedRuleContext(visualgParser.ExpressoesContext,i)


        def SENAO(self):
            return self.getToken(visualgParser.SENAO, 0)

        def getRuleIndex(self):
            return visualgParser.RULE_desvio_condicional

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

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




    def desvio_condicional(self):

        localctx = visualgParser.Desvio_condicionalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_desvio_condicional)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 259
            self.match(visualgParser.SE)
            self.state = 260
            self.expressao_logica()
            self.state = 261
            self.match(visualgParser.ENTAO)
            self.state = 265
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 24)) & ~0x3f) == 0 and ((1 << (_la - 24)) & ((1 << (visualgParser.COMENTARIO - 24)) | (1 << (visualgParser.MATRIZ - 24)) | (1 << (visualgParser.ESCREVA - 24)) | (1 << (visualgParser.LEIA - 24)) | (1 << (visualgParser.SE - 24)) | (1 << (visualgParser.ESCOLHA - 24)) | (1 << (visualgParser.PARA - 24)) | (1 << (visualgParser.REPITA - 24)) | (1 << (visualgParser.ENQUANTO - 24)) | (1 << (visualgParser.INTERROMPA - 24)) | (1 << (visualgParser.ARQUIVO - 24)) | (1 << (visualgParser.PAUSA - 24)) | (1 << (visualgParser.ECO - 24)) | (1 << (visualgParser.CRONOMETRO - 24)) | (1 << (visualgParser.LIMPATELA - 24)) | (1 << (visualgParser.ALEATORIO - 24)) | (1 << (visualgParser.TIMER - 24)) | (1 << (visualgParser.VARIAVEL - 24)))) != 0):
                self.state = 262
                self.expressoes()
                self.state = 267
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 275
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==visualgParser.SENAO:
                self.state = 268
                self.match(visualgParser.SENAO)
                self.state = 272
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while ((((_la - 24)) & ~0x3f) == 0 and ((1 << (_la - 24)) & ((1 << (visualgParser.COMENTARIO - 24)) | (1 << (visualgParser.MATRIZ - 24)) | (1 << (visualgParser.ESCREVA - 24)) | (1 << (visualgParser.LEIA - 24)) | (1 << (visualgParser.SE - 24)) | (1 << (visualgParser.ESCOLHA - 24)) | (1 << (visualgParser.PARA - 24)) | (1 << (visualgParser.REPITA - 24)) | (1 << (visualgParser.ENQUANTO - 24)) | (1 << (visualgParser.INTERROMPA - 24)) | (1 << (visualgParser.ARQUIVO - 24)) | (1 << (visualgParser.PAUSA - 24)) | (1 << (visualgParser.ECO - 24)) | (1 << (visualgParser.CRONOMETRO - 24)) | (1 << (visualgParser.LIMPATELA - 24)) | (1 << (visualgParser.ALEATORIO - 24)) | (1 << (visualgParser.TIMER - 24)) | (1 << (visualgParser.VARIAVEL - 24)))) != 0):
                    self.state = 269
                    self.expressoes()
                    self.state = 274
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 277
            self.match(visualgParser.FIM_SE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Selecao_multiplaContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def ESCOLHA(self):
            return self.getToken(visualgParser.ESCOLHA, 0)

        def VARIAVEL(self):
            return self.getToken(visualgParser.VARIAVEL, 0)

        def FIM_ESCOLHA(self):
            return self.getToken(visualgParser.FIM_ESCOLHA, 0)

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

        def selecao_escolha(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Selecao_escolhaContext)
            else:
                return self.getTypedRuleContext(visualgParser.Selecao_escolhaContext,i)


        def OUTRO_CASO(self):
            return self.getToken(visualgParser.OUTRO_CASO, 0)

        def expressoes(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ExpressoesContext)
            else:
                return self.getTypedRuleContext(visualgParser.ExpressoesContext,i)


        def getRuleIndex(self):
            return visualgParser.RULE_selecao_multipla

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

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




    def selecao_multipla(self):

        localctx = visualgParser.Selecao_multiplaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_selecao_multipla)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 279
            self.match(visualgParser.ESCOLHA)
            self.state = 280
            self.match(visualgParser.VARIAVEL)
            self.state = 289 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 281
                self.match(visualgParser.CASO)
                self.state = 282
                self.selecao_escolha()
                self.state = 286
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while ((((_la - 24)) & ~0x3f) == 0 and ((1 << (_la - 24)) & ((1 << (visualgParser.COMENTARIO - 24)) | (1 << (visualgParser.MATRIZ - 24)) | (1 << (visualgParser.ESCREVA - 24)) | (1 << (visualgParser.LEIA - 24)) | (1 << (visualgParser.SE - 24)) | (1 << (visualgParser.ESCOLHA - 24)) | (1 << (visualgParser.PARA - 24)) | (1 << (visualgParser.REPITA - 24)) | (1 << (visualgParser.ENQUANTO - 24)) | (1 << (visualgParser.INTERROMPA - 24)) | (1 << (visualgParser.ARQUIVO - 24)) | (1 << (visualgParser.PAUSA - 24)) | (1 << (visualgParser.ECO - 24)) | (1 << (visualgParser.CRONOMETRO - 24)) | (1 << (visualgParser.LIMPATELA - 24)) | (1 << (visualgParser.ALEATORIO - 24)) | (1 << (visualgParser.TIMER - 24)) | (1 << (visualgParser.VARIAVEL - 24)))) != 0):
                    self.state = 283
                    self.expressoes()
                    self.state = 288
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 291 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==visualgParser.CASO):
                    break

            self.state = 300
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==visualgParser.OUTRO_CASO:
                self.state = 293
                self.match(visualgParser.OUTRO_CASO)
                self.state = 297
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while ((((_la - 24)) & ~0x3f) == 0 and ((1 << (_la - 24)) & ((1 << (visualgParser.COMENTARIO - 24)) | (1 << (visualgParser.MATRIZ - 24)) | (1 << (visualgParser.ESCREVA - 24)) | (1 << (visualgParser.LEIA - 24)) | (1 << (visualgParser.SE - 24)) | (1 << (visualgParser.ESCOLHA - 24)) | (1 << (visualgParser.PARA - 24)) | (1 << (visualgParser.REPITA - 24)) | (1 << (visualgParser.ENQUANTO - 24)) | (1 << (visualgParser.INTERROMPA - 24)) | (1 << (visualgParser.ARQUIVO - 24)) | (1 << (visualgParser.PAUSA - 24)) | (1 << (visualgParser.ECO - 24)) | (1 << (visualgParser.CRONOMETRO - 24)) | (1 << (visualgParser.LIMPATELA - 24)) | (1 << (visualgParser.ALEATORIO - 24)) | (1 << (visualgParser.TIMER - 24)) | (1 << (visualgParser.VARIAVEL - 24)))) != 0):
                    self.state = 294
                    self.expressoes()
                    self.state = 299
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 302
            self.match(visualgParser.FIM_ESCOLHA)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Para_facaContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def PARA(self):
            return self.getToken(visualgParser.PARA, 0)

        def VARIAVEL(self):
            return self.getToken(visualgParser.VARIAVEL, 0)

        def DE(self):
            return self.getToken(visualgParser.DE, 0)

        def ATE(self):
            return self.getToken(visualgParser.ATE, 0)

        def FACA(self):
            return self.getToken(visualgParser.FACA, 0)

        def FIM_PARA(self):
            return self.getToken(visualgParser.FIM_PARA, 0)

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

        def PASSO(self):
            return self.getToken(visualgParser.PASSO, 0)

        def incremento(self):
            return self.getTypedRuleContext(visualgParser.IncrementoContext,0)


        def expressoes(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ExpressoesContext)
            else:
                return self.getTypedRuleContext(visualgParser.ExpressoesContext,i)


        def getRuleIndex(self):
            return visualgParser.RULE_para_faca

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

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




    def para_faca(self):

        localctx = visualgParser.Para_facaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_para_faca)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 304
            self.match(visualgParser.PARA)
            self.state = 305
            self.match(visualgParser.VARIAVEL)
            self.state = 306
            self.match(visualgParser.DE)
            self.state = 308 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 307
                self.match(visualgParser.INTEIRO)
                self.state = 310 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==visualgParser.INTEIRO):
                    break

            self.state = 312
            self.match(visualgParser.ATE)
            self.state = 314 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 313
                self.match(visualgParser.INTEIRO)
                self.state = 316 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==visualgParser.INTEIRO):
                    break

            self.state = 320
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==visualgParser.PASSO:
                self.state = 318
                self.match(visualgParser.PASSO)
                self.state = 319
                self.incremento()


            self.state = 322
            self.match(visualgParser.FACA)
            self.state = 326
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 24)) & ~0x3f) == 0 and ((1 << (_la - 24)) & ((1 << (visualgParser.COMENTARIO - 24)) | (1 << (visualgParser.MATRIZ - 24)) | (1 << (visualgParser.ESCREVA - 24)) | (1 << (visualgParser.LEIA - 24)) | (1 << (visualgParser.SE - 24)) | (1 << (visualgParser.ESCOLHA - 24)) | (1 << (visualgParser.PARA - 24)) | (1 << (visualgParser.REPITA - 24)) | (1 << (visualgParser.ENQUANTO - 24)) | (1 << (visualgParser.INTERROMPA - 24)) | (1 << (visualgParser.ARQUIVO - 24)) | (1 << (visualgParser.PAUSA - 24)) | (1 << (visualgParser.ECO - 24)) | (1 << (visualgParser.CRONOMETRO - 24)) | (1 << (visualgParser.LIMPATELA - 24)) | (1 << (visualgParser.ALEATORIO - 24)) | (1 << (visualgParser.TIMER - 24)) | (1 << (visualgParser.VARIAVEL - 24)))) != 0):
                self.state = 323
                self.expressoes()
                self.state = 328
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 329
            self.match(visualgParser.FIM_PARA)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Enquanto_facaContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def ENQUANTO(self):
            return self.getToken(visualgParser.ENQUANTO, 0)

        def expressao_logica(self):
            return self.getTypedRuleContext(visualgParser.Expressao_logicaContext,0)


        def FACA(self):
            return self.getToken(visualgParser.FACA, 0)

        def FIM_ENQUANTO(self):
            return self.getToken(visualgParser.FIM_ENQUANTO, 0)

        def expressoes(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ExpressoesContext)
            else:
                return self.getTypedRuleContext(visualgParser.ExpressoesContext,i)


        def getRuleIndex(self):
            return visualgParser.RULE_enquanto_faca

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

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




    def enquanto_faca(self):

        localctx = visualgParser.Enquanto_facaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_enquanto_faca)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 331
            self.match(visualgParser.ENQUANTO)
            self.state = 332
            self.expressao_logica()
            self.state = 333
            self.match(visualgParser.FACA)
            self.state = 337
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 24)) & ~0x3f) == 0 and ((1 << (_la - 24)) & ((1 << (visualgParser.COMENTARIO - 24)) | (1 << (visualgParser.MATRIZ - 24)) | (1 << (visualgParser.ESCREVA - 24)) | (1 << (visualgParser.LEIA - 24)) | (1 << (visualgParser.SE - 24)) | (1 << (visualgParser.ESCOLHA - 24)) | (1 << (visualgParser.PARA - 24)) | (1 << (visualgParser.REPITA - 24)) | (1 << (visualgParser.ENQUANTO - 24)) | (1 << (visualgParser.INTERROMPA - 24)) | (1 << (visualgParser.ARQUIVO - 24)) | (1 << (visualgParser.PAUSA - 24)) | (1 << (visualgParser.ECO - 24)) | (1 << (visualgParser.CRONOMETRO - 24)) | (1 << (visualgParser.LIMPATELA - 24)) | (1 << (visualgParser.ALEATORIO - 24)) | (1 << (visualgParser.TIMER - 24)) | (1 << (visualgParser.VARIAVEL - 24)))) != 0):
                self.state = 334
                self.expressoes()
                self.state = 339
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 340
            self.match(visualgParser.FIM_ENQUANTO)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Repita_ateContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def REPITA(self):
            return self.getToken(visualgParser.REPITA, 0)

        def ATE(self):
            return self.getToken(visualgParser.ATE, 0)

        def expressao_logica(self):
            return self.getTypedRuleContext(visualgParser.Expressao_logicaContext,0)


        def expressoes(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.ExpressoesContext)
            else:
                return self.getTypedRuleContext(visualgParser.ExpressoesContext,i)


        def getRuleIndex(self):
            return visualgParser.RULE_repita_ate

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

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




    def repita_ate(self):

        localctx = visualgParser.Repita_ateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_repita_ate)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 342
            self.match(visualgParser.REPITA)
            self.state = 346
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 24)) & ~0x3f) == 0 and ((1 << (_la - 24)) & ((1 << (visualgParser.COMENTARIO - 24)) | (1 << (visualgParser.MATRIZ - 24)) | (1 << (visualgParser.ESCREVA - 24)) | (1 << (visualgParser.LEIA - 24)) | (1 << (visualgParser.SE - 24)) | (1 << (visualgParser.ESCOLHA - 24)) | (1 << (visualgParser.PARA - 24)) | (1 << (visualgParser.REPITA - 24)) | (1 << (visualgParser.ENQUANTO - 24)) | (1 << (visualgParser.INTERROMPA - 24)) | (1 << (visualgParser.ARQUIVO - 24)) | (1 << (visualgParser.PAUSA - 24)) | (1 << (visualgParser.ECO - 24)) | (1 << (visualgParser.CRONOMETRO - 24)) | (1 << (visualgParser.LIMPATELA - 24)) | (1 << (visualgParser.ALEATORIO - 24)) | (1 << (visualgParser.TIMER - 24)) | (1 << (visualgParser.VARIAVEL - 24)))) != 0):
                self.state = 343
                self.expressoes()
                self.state = 348
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 349
            self.match(visualgParser.ATE)
            self.state = 350
            self.expressao_logica()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AleatorioContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def ALEATORIO(self):
            return self.getToken(visualgParser.ALEATORIO, 0)

        def ABRE_COLCHETES(self):
            return self.getToken(visualgParser.ABRE_COLCHETES, 0)

        def ON(self):
            return self.getToken(visualgParser.ON, 0)

        def FECHA_COLCHETES(self):
            return self.getToken(visualgParser.FECHA_COLCHETES, 0)

        def OFF(self):
            return self.getToken(visualgParser.OFF, 0)

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

        def VIRGULA(self):
            return self.getToken(visualgParser.VIRGULA, 0)

        def getRuleIndex(self):
            return visualgParser.RULE_aleatorio

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

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




    def aleatorio(self):

        localctx = visualgParser.AleatorioContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_aleatorio)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 352
            self.match(visualgParser.ALEATORIO)
            self.state = 369
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,38,self._ctx)
            if la_ == 1:
                self.state = 353
                self.match(visualgParser.ABRE_COLCHETES)
                self.state = 354
                self.match(visualgParser.ON)
                self.state = 355
                self.match(visualgParser.FECHA_COLCHETES)
                pass

            elif la_ == 2:
                self.state = 356
                self.match(visualgParser.ABRE_COLCHETES)
                self.state = 357
                self.match(visualgParser.OFF)
                self.state = 358
                self.match(visualgParser.FECHA_COLCHETES)
                pass

            elif la_ == 3:
                self.state = 362
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,36,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 359
                        self.match(visualgParser.INTEIRO) 
                    self.state = 364
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,36,self._ctx)

                self.state = 366
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==visualgParser.VIRGULA:
                    self.state = 365
                    self.match(visualgParser.VIRGULA)


                self.state = 368
                self.match(visualgParser.INTEIRO)
                pass


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


    class ArquivoContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def ARQUIVO(self):
            return self.getToken(visualgParser.ARQUIVO, 0)

        def NOME_ARQUIVO(self):
            return self.getToken(visualgParser.NOME_ARQUIVO, 0)

        def getRuleIndex(self):
            return visualgParser.RULE_arquivo

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

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




    def arquivo(self):

        localctx = visualgParser.ArquivoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_arquivo)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 371
            self.match(visualgParser.ARQUIVO)
            self.state = 372
            self.match(visualgParser.NOME_ARQUIVO)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TimerContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def TIMER(self):
            return self.getToken(visualgParser.TIMER, 0)

        def ABRE_COLCHETES(self):
            return self.getToken(visualgParser.ABRE_COLCHETES, 0)

        def ON(self):
            return self.getToken(visualgParser.ON, 0)

        def FECHA_COLCHETES(self):
            return self.getToken(visualgParser.FECHA_COLCHETES, 0)

        def OFF(self):
            return self.getToken(visualgParser.OFF, 0)

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

        def getRuleIndex(self):
            return visualgParser.RULE_timer

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

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




    def timer(self):

        localctx = visualgParser.TimerContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_timer)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 374
            self.match(visualgParser.TIMER)
            self.state = 387
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,40,self._ctx)
            if la_ == 1:
                self.state = 375
                self.match(visualgParser.ABRE_COLCHETES)
                self.state = 376
                self.match(visualgParser.ON)
                self.state = 377
                self.match(visualgParser.FECHA_COLCHETES)
                pass

            elif la_ == 2:
                self.state = 378
                self.match(visualgParser.ABRE_COLCHETES)
                self.state = 379
                self.match(visualgParser.OFF)
                self.state = 380
                self.match(visualgParser.FECHA_COLCHETES)
                pass

            elif la_ == 3:
                self.state = 384
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==visualgParser.INTEIRO:
                    self.state = 381
                    self.match(visualgParser.INTEIRO)
                    self.state = 386
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass


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


    class Lista_de_variaveisContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def getRuleIndex(self):
            return visualgParser.RULE_lista_de_variaveis

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

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




    def lista_de_variaveis(self):

        localctx = visualgParser.Lista_de_variaveisContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_lista_de_variaveis)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 389
            self.match(visualgParser.VARIAVEL)
            self.state = 394
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==visualgParser.VIRGULA:
                self.state = 390
                self.match(visualgParser.VIRGULA)
                self.state = 391
                self.match(visualgParser.VARIAVEL)
                self.state = 396
                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 Lista_numerosContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def selecao_aritmetica(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Selecao_aritmeticaContext)
            else:
                return self.getTypedRuleContext(visualgParser.Selecao_aritmeticaContext,i)


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

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

        def getRuleIndex(self):
            return visualgParser.RULE_lista_numeros

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

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




    def lista_numeros(self):

        localctx = visualgParser.Lista_numerosContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_lista_numeros)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 399
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [visualgParser.MATRIZ, visualgParser.INTEIRO, visualgParser.REAL, visualgParser.VARIAVEL]:
                self.state = 397
                self.selecao_aritmetica()
                pass
            elif token in [visualgParser.BOOL]:
                self.state = 398
                self.match(visualgParser.BOOL)
                pass
            else:
                raise NoViableAltException(self)

            self.state = 408
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==visualgParser.VIRGULA:
                self.state = 401
                self.match(visualgParser.VIRGULA)
                self.state = 404
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [visualgParser.MATRIZ, visualgParser.INTEIRO, visualgParser.REAL, visualgParser.VARIAVEL]:
                    self.state = 402
                    self.selecao_aritmetica()
                    pass
                elif token in [visualgParser.BOOL]:
                    self.state = 403
                    self.match(visualgParser.BOOL)
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 410
                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 Lista_de_intervaloContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def ABRE_COLCHETES(self):
            return self.getToken(visualgParser.ABRE_COLCHETES, 0)

        def intervalo(self):
            return self.getTypedRuleContext(visualgParser.IntervaloContext,0)


        def FECHA_COLCHETES(self):
            return self.getToken(visualgParser.FECHA_COLCHETES, 0)

        def getRuleIndex(self):
            return visualgParser.RULE_lista_de_intervalo

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

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




    def lista_de_intervalo(self):

        localctx = visualgParser.Lista_de_intervaloContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_lista_de_intervalo)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 411
            self.match(visualgParser.ABRE_COLCHETES)
            self.state = 412
            self.intervalo()
            self.state = 413
            self.match(visualgParser.FECHA_COLCHETES)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Tipo_da_variavelContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def TIPO_DE_DADO(self):
            return self.getToken(visualgParser.TIPO_DE_DADO, 0)

        def tipo_vetor(self):
            return self.getTypedRuleContext(visualgParser.Tipo_vetorContext,0)


        def getRuleIndex(self):
            return visualgParser.RULE_tipo_da_variavel

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

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




    def tipo_da_variavel(self):

        localctx = visualgParser.Tipo_da_variavelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_tipo_da_variavel)
        try:
            self.state = 417
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [visualgParser.TIPO_DE_DADO]:
                self.enterOuterAlt(localctx, 1)
                self.state = 415
                self.match(visualgParser.TIPO_DE_DADO)
                pass
            elif token in [visualgParser.VETOR]:
                self.enterOuterAlt(localctx, 2)
                self.state = 416
                self.tipo_vetor()
                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 Tipo_vetorContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def VETOR(self):
            return self.getToken(visualgParser.VETOR, 0)

        def lista_de_intervalo(self):
            return self.getTypedRuleContext(visualgParser.Lista_de_intervaloContext,0)


        def DE(self):
            return self.getToken(visualgParser.DE, 0)

        def TIPO_DE_DADO(self):
            return self.getToken(visualgParser.TIPO_DE_DADO, 0)

        def getRuleIndex(self):
            return visualgParser.RULE_tipo_vetor

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

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




    def tipo_vetor(self):

        localctx = visualgParser.Tipo_vetorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_tipo_vetor)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 419
            self.match(visualgParser.VETOR)
            self.state = 420
            self.lista_de_intervalo()
            self.state = 421
            self.match(visualgParser.DE)
            self.state = 422
            self.match(visualgParser.TIPO_DE_DADO)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class IntervaloContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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

        def getRuleIndex(self):
            return visualgParser.RULE_intervalo

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

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




    def intervalo(self):

        localctx = visualgParser.IntervaloContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_intervalo)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 425 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 424
                self.match(visualgParser.INTEIRO)
                self.state = 427 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==visualgParser.INTEIRO):
                    break

            self.state = 429
            self.match(visualgParser.PONTO_PONTO)
            self.state = 431 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 430
                self.match(visualgParser.INTEIRO)
                self.state = 433 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==visualgParser.INTEIRO):
                    break

            self.state = 445
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==visualgParser.VIRGULA:
                self.state = 435
                self.match(visualgParser.VIRGULA)
                self.state = 437 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 436
                    self.match(visualgParser.INTEIRO)
                    self.state = 439 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not (_la==visualgParser.INTEIRO):
                        break

                self.state = 441
                self.match(visualgParser.PONTO_PONTO)
                self.state = 442
                self.match(visualgParser.INTEIRO)
                self.state = 447
                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 Print_variavelContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def calculo(self):
            return self.getTypedRuleContext(visualgParser.CalculoContext,0)


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

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

        def getRuleIndex(self):
            return visualgParser.RULE_print_variavel

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

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




    def print_variavel(self):

        localctx = visualgParser.Print_variavelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_print_variavel)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 448
            self.calculo()

            self.state = 449
            self.match(visualgParser.DOIS_PONTOS)
            self.state = 451 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 450
                self.match(visualgParser.INTEIRO)
                self.state = 453 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==visualgParser.INTEIRO):
                    break

            self.state = 461
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==visualgParser.DOIS_PONTOS:
                self.state = 455
                self.match(visualgParser.DOIS_PONTOS)
                self.state = 457 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 456
                    self.match(visualgParser.INTEIRO)
                    self.state = 459 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not (_la==visualgParser.INTEIRO):
                        break



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


    class CalculoContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def expressao_aritmetica(self):
            return self.getTypedRuleContext(visualgParser.Expressao_aritmeticaContext,0)


        def expressao_logica(self):
            return self.getTypedRuleContext(visualgParser.Expressao_logicaContext,0)


        def chamar_funcao(self):
            return self.getTypedRuleContext(visualgParser.Chamar_funcaoContext,0)


        def getRuleIndex(self):
            return visualgParser.RULE_calculo

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

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




    def calculo(self):

        localctx = visualgParser.CalculoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_calculo)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 466
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,53,self._ctx)
            if la_ == 1:
                self.state = 463
                self.expressao_aritmetica()
                pass

            elif la_ == 2:
                self.state = 464
                self.expressao_logica()
                pass

            elif la_ == 3:
                self.state = 465
                self.chamar_funcao()
                pass


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


    class Expressao_aritmeticaContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def selecao_aritmetica(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Selecao_aritmeticaContext)
            else:
                return self.getTypedRuleContext(visualgParser.Selecao_aritmeticaContext,i)


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

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

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

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

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

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

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

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

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

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

        def getRuleIndex(self):
            return visualgParser.RULE_expressao_aritmetica

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

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




    def expressao_aritmetica(self):

        localctx = visualgParser.Expressao_aritmeticaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_expressao_aritmetica)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 469
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==visualgParser.ABRE_PARENTESES:
                self.state = 468
                self.match(visualgParser.ABRE_PARENTESES)


            self.state = 472
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==visualgParser.OPERADOR_UNARIO:
                self.state = 471
                self.match(visualgParser.OPERADOR_UNARIO)


            self.state = 474
            self.selecao_aritmetica()
            self.state = 488
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,59,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 475
                    _la = self._input.LA(1)
                    if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << visualgParser.OP_SOM) | (1 << visualgParser.OP_SUB) | (1 << visualgParser.OP_MUL) | (1 << visualgParser.OP_DIV) | (1 << visualgParser.OP_RES) | (1 << visualgParser.OP_POT) | (1 << visualgParser.OP_DIV_INT))) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 477
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==visualgParser.ABRE_PARENTESES:
                        self.state = 476
                        self.match(visualgParser.ABRE_PARENTESES)


                    self.state = 480
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==visualgParser.OPERADOR_UNARIO:
                        self.state = 479
                        self.match(visualgParser.OPERADOR_UNARIO)


                    self.state = 482
                    self.selecao_aritmetica()
                    self.state = 484
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,58,self._ctx)
                    if la_ == 1:
                        self.state = 483
                        self.match(visualgParser.FECHA_PARENTESES)

             
                self.state = 490
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,59,self._ctx)

            self.state = 492
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,60,self._ctx)
            if la_ == 1:
                self.state = 491
                self.match(visualgParser.FECHA_PARENTESES)


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


    class Expressao_logicaContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def selecao_logica(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(visualgParser.Selecao_logicaContext)
            else:
                return self.getTypedRuleContext(visualgParser.Selecao_logicaContext,i)


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

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

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

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

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

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

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

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

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

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

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

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

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

        def getRuleIndex(self):
            return visualgParser.RULE_expressao_logica

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

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




    def expressao_logica(self):

        localctx = visualgParser.Expressao_logicaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_expressao_logica)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 495
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==visualgParser.ABRE_PARENTESES:
                self.state = 494
                self.match(visualgParser.ABRE_PARENTESES)


            self.state = 498
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==visualgParser.OPERADOR_UNARIO:
                self.state = 497
                self.match(visualgParser.OPERADOR_UNARIO)


            self.state = 500
            self.selecao_logica()
            self.state = 532
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << visualgParser.OP_MAIOR) | (1 << visualgParser.OP_MAIOR_IGUAL) | (1 << visualgParser.OP_MENOR) | (1 << visualgParser.OP_MENOR_IGUAL) | (1 << visualgParser.OP_IGUAL) | (1 << visualgParser.OP_DIFERENTE))) != 0):
                self.state = 501
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << visualgParser.OP_MAIOR) | (1 << visualgParser.OP_MAIOR_IGUAL) | (1 << visualgParser.OP_MENOR) | (1 << visualgParser.OP_MENOR_IGUAL) | (1 << visualgParser.OP_IGUAL) | (1 << visualgParser.OP_DIFERENTE))) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 503
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==visualgParser.ABRE_PARENTESES:
                    self.state = 502
                    self.match(visualgParser.ABRE_PARENTESES)


                self.state = 506
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==visualgParser.OPERADOR_UNARIO:
                    self.state = 505
                    self.match(visualgParser.OPERADOR_UNARIO)


                self.state = 508
                self.selecao_logica()
                self.state = 510
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,65,self._ctx)
                if la_ == 1:
                    self.state = 509
                    self.match(visualgParser.FECHA_PARENTESES)


                self.state = 529
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << visualgParser.OP_NAO) | (1 << visualgParser.OP_OU) | (1 << visualgParser.OP_E) | (1 << visualgParser.OP_XOU))) != 0):
                    self.state = 512
                    _la = self._input.LA(1)
                    if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << visualgParser.OP_NAO) | (1 << visualgParser.OP_OU) | (1 << visualgParser.OP_E) | (1 << visualgParser.OP_XOU))) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 513
                    self.selecao_logica()
                    self.state = 525
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << visualgParser.OP_MAIOR) | (1 << visualgParser.OP_MAIOR_IGUAL) | (1 << visualgParser.OP_MENOR) | (1 << visualgParser.OP_MENOR_IGUAL) | (1 << visualgParser.OP_IGUAL) | (1 << visualgParser.OP_DIFERENTE))) != 0):
                        self.state = 514
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << visualgParser.OP_MAIOR) | (1 << visualgParser.OP_MAIOR_IGUAL) | (1 << visualgParser.OP_MENOR) | (1 << visualgParser.OP_MENOR_IGUAL) | (1 << visualgParser.OP_IGUAL) | (1 << visualgParser.OP_DIFERENTE))) != 0)):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 516
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if _la==visualgParser.ABRE_PARENTESES:
                            self.state = 515
                            self.match(visualgParser.ABRE_PARENTESES)


                        self.state = 519
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if _la==visualgParser.OPERADOR_UNARIO:
                            self.state = 518
                            self.match(visualgParser.OPERADOR_UNARIO)


                        self.state = 521
                        self.selecao_logica()
                        self.state = 523
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,68,self._ctx)
                        if la_ == 1:
                            self.state = 522
                            self.match(visualgParser.FECHA_PARENTESES)




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



            self.state = 535
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,72,self._ctx)
            if la_ == 1:
                self.state = 534
                self.match(visualgParser.FECHA_PARENTESES)


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


    class Selecao_aritmeticaContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def VARIAVEL(self):
            return self.getToken(visualgParser.VARIAVEL, 0)

        def INTEIRO(self):
            return self.getToken(visualgParser.INTEIRO, 0)

        def REAL(self):
            return self.getToken(visualgParser.REAL, 0)

        def MATRIZ(self):
            return self.getToken(visualgParser.MATRIZ, 0)

        def getRuleIndex(self):
            return visualgParser.RULE_selecao_aritmetica

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

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




    def selecao_aritmetica(self):

        localctx = visualgParser.Selecao_aritmeticaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_selecao_aritmetica)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 537
            _la = self._input.LA(1)
            if not(((((_la - 28)) & ~0x3f) == 0 and ((1 << (_la - 28)) & ((1 << (visualgParser.MATRIZ - 28)) | (1 << (visualgParser.INTEIRO - 28)) | (1 << (visualgParser.REAL - 28)) | (1 << (visualgParser.VARIAVEL - 28)))) != 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 Selecao_logicaContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def VARIAVEL(self):
            return self.getToken(visualgParser.VARIAVEL, 0)

        def INTEIRO(self):
            return self.getToken(visualgParser.INTEIRO, 0)

        def REAL(self):
            return self.getToken(visualgParser.REAL, 0)

        def BOOL(self):
            return self.getToken(visualgParser.BOOL, 0)

        def getRuleIndex(self):
            return visualgParser.RULE_selecao_logica

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

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




    def selecao_logica(self):

        localctx = visualgParser.Selecao_logicaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_selecao_logica)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 539
            _la = self._input.LA(1)
            if not(((((_la - 36)) & ~0x3f) == 0 and ((1 << (_la - 36)) & ((1 << (visualgParser.INTEIRO - 36)) | (1 << (visualgParser.REAL - 36)) | (1 << (visualgParser.BOOL - 36)) | (1 << (visualgParser.VARIAVEL - 36)))) != 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 Selecao_escolhaContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def INTEIRO(self):
            return self.getToken(visualgParser.INTEIRO, 0)

        def REAL(self):
            return self.getToken(visualgParser.REAL, 0)

        def STRING(self):
            return self.getToken(visualgParser.STRING, 0)

        def BOOL(self):
            return self.getToken(visualgParser.BOOL, 0)

        def getRuleIndex(self):
            return visualgParser.RULE_selecao_escolha

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

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




    def selecao_escolha(self):

        localctx = visualgParser.Selecao_escolhaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_selecao_escolha)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 541
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << visualgParser.STRING) | (1 << visualgParser.INTEIRO) | (1 << visualgParser.REAL) | (1 << visualgParser.BOOL))) != 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 IncrementoContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def OP_SUB(self):
            return self.getToken(visualgParser.OP_SUB, 0)

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

        def getRuleIndex(self):
            return visualgParser.RULE_incremento

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

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




    def incremento(self):

        localctx = visualgParser.IncrementoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_incremento)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 544
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==visualgParser.OP_SUB:
                self.state = 543
                self.match(visualgParser.OP_SUB)


            self.state = 547 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 546
                self.match(visualgParser.INTEIRO)
                self.state = 549 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==visualgParser.INTEIRO):
                    break

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





