Explorar o código

Analisador lexico finalizado

Lucas de Souza %!s(int64=6) %!d(string=hai) anos
pai
achega
7465d8bcdb

+ 2 - 8
grammar/index.js

@@ -1,9 +1,3 @@
-import {ivprogLexer} from './ivprogLexer';
-import {ivprogParser} from './ivprogParser';
-import {ivprogVisitor} from './ivprogVisitor';
-import {ivprogListener} from './ivprogListener';
+import * as ptBR from './pt-br/ivprog.g4';
 
-exports.ivprogVisitor = ivprogVisitor;
-exports.ivprogParser = ivprogParser;
-exports.ivprogLexer = ivprogLexer;
-exports.ivprogListener = ivprogListener;
+exports.pt_br = ptBR.ivprog;

+ 0 - 182
grammar/ivprog.g4

@@ -1,182 +0,0 @@
-grammar ivprog;
-@parser::header
-{
-  import {ASA, NoGlobal} from '../js/asa';
-}
-
-@parser::members
-{
-  this.criarTrechoCodigoFonte = function(tokenAntlr)
-    {
-      if (tokenAntlr != null)
-      {
-        const linha = tokenAntlr.getLine();
-        const coluna = tokenAntlr.getCharPositionInLine();
-        const tamanhoTexto = tokenAntlr.getText().length();
-        
-        return {linha: linha, coluna: coluna, tamanhoTexto: tamanhoTexto};
-      }
-      
-      return null;
-  }
-}
-
-
-
-PR_PROGRAMA     : 'programa'    ;
-PR_REAL       : 'real'    ;
-PR_VAZIO        : 'vazio'   ;
-PR_LOGICO       : 'logico'    ;
-PR_CADEIA       : 'cadeia'    ;
-PR_INTEIRO        : 'inteiro'   ;
-PR_CARACTER     : 'caracter'    ;    
-PR_ESCOLHA        : 'escolha'   ;
-PR_CASO       : 'caso'    ;
-PR_CONTRARIO      : 'contrario' ;
-PR_CONST        : 'const'   ;
-PR_FUNCAO       : 'funcao'    ;
-PR_RETORNE        : 'retorne'   ;  
-PR_PARA       : 'para'    ;
-PR_PARE       : 'pare'    ;
-PR_FACA       : 'faca'    ;
-PR_ENQUANTO     : 'enquanto'    ;
-PR_SE       : 'se'    ;
-PR_SENAO        : 'senao'   ;
-
-
-GAMBIARRA   : '.' |'á'| 'à'| 'ã'|'â'|'é'|'ê'|'í'|'ó'|'ô'|'õ'|'ú'|'ü'|'ç'|'Ä'|'À'|'Ã'|'Â'|'É'|'Ê'|'Ë'|'Ó'|'Ô'|'Õ'|'Ú'|'Ü'|'Ç'|'#'|'$'|'"'|'§'|'?'|'¹'|'²'|'³'|'£'|'¢'|'¬'|'ª'|'º'|'~'|'\''|'`'|'\\'|'@';
- 
-fragment PR_FALSO     : 'falso'   ;
-fragment PR_VERDADEIRO    : 'verdadeiro'    ;
-
-OPERADOR_NAO      : 'nao'   ;
-
-LOGICO        :   PR_VERDADEIRO | PR_FALSO  ;
-
-ID        : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*  ;
-
-ID_BIBLIOTECA     : ID '.' ID;
-
-INTEIRO         : '0'..'9'+ | ('0x'|'0X')(DIGIT_HEX)+ | ('0b'|'0B')('0'|'1')+;
-
-REAL          :   ('0'..'9')+ '.' ('0'..'9')+ ;
-    
-CADEIA        : '"' ( SEQ_ESC | ~('\\'|'"') )* '"'  ;
-
-CARACTER        :   '\'' ( SEQ_ESC | ~('\''|'\\') ) '\''  ;
-
-ESPACO        : ( ' ' | '\t' | '\r' | '\n') -> skip  ;
-
-
-fragment DIGIT_HEX    :   ('0'..'9'|'a'..'f'|'A'..'F')  ;
-
-fragment SEQ_ESC      :  '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')  |   ESC_UNICODE  |   ESC_OCTAL   ;
-
-fragment ESC_OCTAL    : '\\' ('0'..'3') ('0'..'7') ('0'..'7')  |   '\\' ('0'..'7') ('0'..'7')    |   '\\' ('0'..'7')    ;
-
-fragment ESC_UNICODE    : '\\' 'u' DIGIT_HEX DIGIT_HEX DIGIT_HEX DIGIT_HEX  ;
-
-COMENTARIO      :   
-
-  ('//' ~('\n'|'\r')* '\r'? '\n' |  
-  
-   '/*' ( options {greedy=false;} : . )* '*/') -> skip
- ;
-
-
-parse returns [asa]:
-
-  prog = programa EOF
-  {
-    $asa = $prog.asa;
-  }
-;
-
-
-programa returns [asa] :
-
-  PR_PROGRAMA
-  '{'   
-    {
-      $asa = new ASA();
-    }
-
-    (declaracoesGlobais[$asa])*
-  '}'
-;
-
-declaracoesGlobais [asa]:
-  vList = listaDeclaracoes
-  {
-    if ($asa != null) {
-      this.globais = new NoGlobal();
-      $vList.lista.forEach( v => this.globais.addDeclaracao(v));
-      $asa.nos.push($vList.lista);
-    }
-  }
-;
-
-listaDeclaracoes returns [lista]
-@init{
-  $lista = [];
-}:
-  (tokenConst = PR_CONST)? informacaoTipoDado = declaracaoTipoDado
-
-  ( vDeclaracao = declaracao[$tokenConst, $informacaoTipoDado.informacaoTipoDado]
-    {
-      if($ctx.vDeclaracao) {
-        $lista.push($vDeclaracao.rDeclaracao);
-      }
-      $ctx.vDeclaracao = null;
-    }
-  )
-  ( ',' vDeclaracao = declaracao[$tokenConst, $informacaoTipoDado.informacaoTipoDado]
-    {
-      if($ctx.vDeclaracao) {
-        $lista.push($vDeclaracao.rDeclaracao);
-      }
-      $ctx.vDeclaracao = null;
-    }
-  )*
-;
-
-declaracao [tokenConst, informacaoTipoDado] returns[rDeclaracao]:  
-
-  (ID (tk1 = '[' (ind1 = expressao)? ']' (tk2 = '[' (ind2 = expressao)? ']')?)? ('=' inicializacao = expressao)?) 
-  {
-    const constante = ($tokenConst != null);
-    const tipoDado = ($informacaoTipoDado != null)? $informacaoTipoDado.tipoDado : null;
-    const nome = ($ID != null)? $ID.text : null;
-    
-    if (($tk1 == null) && ($tk2 == null))
-      $rDeclaracao = new NoDeclaracaoVariavel(nome, tipoDado, constante);
-    else
-    
-    if (($tk1 != null) && ($tk2 == null))
-      $rDeclaracao = new NoDeclaracaoVetor(nome, tipoDado, $ind1.text, constante);
-    
-    else
-    
-    if (($tk1 != null) && ($tk2 != null))
-      $rDeclaracao = new NoDeclaracaoMatriz(nome, tipoDado, $ind1.text, $ind2.text, constante);
-  
-    $rDeclaracao.setInicializacao(inicializacao);
-    $rDeclaracao.setTrechoCodigoFonteNome(criarTrechoCodigoFonte($ID));
-    $rDeclaracao.setTrechoCodigoFonteTipoDado(($informacaoTipoDado != null)? $informacaoTipoDado.getTrechoCodigoFonte(): null);
-  }
-;
-
-declaracaoTipoDado returns[informacaoTipoDado]:
-
-  (tokenTipoDado = PR_INTEIRO | tokenTipoDado = PR_REAL | tokenTipoDado = PR_CARACTER | tokenTipoDado = PR_CADEIA | tokenTipoDado = PR_LOGICO)
-  {
-    $informacaoTipoDado = new InformacaoTipoDado();
-    $informacaoTipoDado.setTipoDado($tokenTipoDado);
-    $informacaoTipoDado.setTrechoCodigoFonte(criarTrechoCodigoFonte($tokenTipoDado));
-  }
-;
-
-expressao:
-  INTEIRO
-  | CADEIA
-;

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 90
grammar/ivprog.interp


+ 0 - 62
grammar/ivprog.tokens

@@ -1,62 +0,0 @@
-T__0=1
-T__1=2
-T__2=3
-T__3=4
-T__4=5
-T__5=6
-PR_PROGRAMA=7
-PR_REAL=8
-PR_VAZIO=9
-PR_LOGICO=10
-PR_CADEIA=11
-PR_INTEIRO=12
-PR_CARACTER=13
-PR_ESCOLHA=14
-PR_CASO=15
-PR_CONTRARIO=16
-PR_CONST=17
-PR_FUNCAO=18
-PR_RETORNE=19
-PR_PARA=20
-PR_PARE=21
-PR_FACA=22
-PR_ENQUANTO=23
-PR_SE=24
-PR_SENAO=25
-GAMBIARRA=26
-OPERADOR_NAO=27
-LOGICO=28
-ID=29
-ID_BIBLIOTECA=30
-INTEIRO=31
-REAL=32
-CADEIA=33
-CARACTER=34
-ESPACO=35
-COMENTARIO=36
-'{'=1
-'}'=2
-','=3
-'['=4
-']'=5
-'='=6
-'programa'=7
-'real'=8
-'vazio'=9
-'logico'=10
-'cadeia'=11
-'inteiro'=12
-'caracter'=13
-'escolha'=14
-'caso'=15
-'contrario'=16
-'const'=17
-'funcao'=18
-'retorne'=19
-'para'=20
-'pare'=21
-'faca'=22
-'enquanto'=23
-'se'=24
-'senao'=25
-'nao'=27

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 131
grammar/ivprogLexer.interp


+ 0 - 355
grammar/ivprogLexer.js

@@ -1,355 +0,0 @@
-// Generated from grammar/ivprog.g4 by ANTLR 4.7.1
-// jshint ignore: start
-var antlr4 = require('antlr4/index');
-
-
-var serializedATN = ["\u0003\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964",
-    "\u0002&\u0180\b\u0001\u0004\u0002\t\u0002\u0004\u0003\t\u0003\u0004",
-    "\u0004\t\u0004\u0004\u0005\t\u0005\u0004\u0006\t\u0006\u0004\u0007\t",
-    "\u0007\u0004\b\t\b\u0004\t\t\t\u0004\n\t\n\u0004\u000b\t\u000b\u0004",
-    "\f\t\f\u0004\r\t\r\u0004\u000e\t\u000e\u0004\u000f\t\u000f\u0004\u0010",
-    "\t\u0010\u0004\u0011\t\u0011\u0004\u0012\t\u0012\u0004\u0013\t\u0013",
-    "\u0004\u0014\t\u0014\u0004\u0015\t\u0015\u0004\u0016\t\u0016\u0004\u0017",
-    "\t\u0017\u0004\u0018\t\u0018\u0004\u0019\t\u0019\u0004\u001a\t\u001a",
-    "\u0004\u001b\t\u001b\u0004\u001c\t\u001c\u0004\u001d\t\u001d\u0004\u001e",
-    "\t\u001e\u0004\u001f\t\u001f\u0004 \t \u0004!\t!\u0004\"\t\"\u0004#",
-    "\t#\u0004$\t$\u0004%\t%\u0004&\t&\u0004\'\t\'\u0004(\t(\u0004)\t)\u0004",
-    "*\t*\u0004+\t+\u0003\u0002\u0003\u0002\u0003\u0003\u0003\u0003\u0003",
-    "\u0004\u0003\u0004\u0003\u0005\u0003\u0005\u0003\u0006\u0003\u0006\u0003",
-    "\u0007\u0003\u0007\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003",
-    "\b\u0003\b\u0003\b\u0003\t\u0003\t\u0003\t\u0003\t\u0003\t\u0003\n\u0003",
-    "\n\u0003\n\u0003\n\u0003\n\u0003\n\u0003\u000b\u0003\u000b\u0003\u000b",
-    "\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\f\u0003\f\u0003",
-    "\f\u0003\f\u0003\f\u0003\f\u0003\f\u0003\r\u0003\r\u0003\r\u0003\r\u0003",
-    "\r\u0003\r\u0003\r\u0003\r\u0003\u000e\u0003\u000e\u0003\u000e\u0003",
-    "\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003",
-    "\u000f\u0003\u000f\u0003\u000f\u0003\u000f\u0003\u000f\u0003\u000f\u0003",
-    "\u000f\u0003\u000f\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003",
-    "\u0010\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003",
-    "\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0012\u0003",
-    "\u0012\u0003\u0012\u0003\u0012\u0003\u0012\u0003\u0012\u0003\u0013\u0003",
-    "\u0013\u0003\u0013\u0003\u0013\u0003\u0013\u0003\u0013\u0003\u0013\u0003",
-    "\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003",
-    "\u0014\u0003\u0014\u0003\u0015\u0003\u0015\u0003\u0015\u0003\u0015\u0003",
-    "\u0015\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003",
-    "\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0018\u0003",
-    "\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
-    "\u0018\u0003\u0018\u0003\u0019\u0003\u0019\u0003\u0019\u0003\u001a\u0003",
-    "\u001a\u0003\u001a\u0003\u001a\u0003\u001a\u0003\u001a\u0003\u001b\u0003",
-    "\u001b\u0003\u001c\u0003\u001c\u0003\u001c\u0003\u001c\u0003\u001c\u0003",
-    "\u001c\u0003\u001d\u0003\u001d\u0003\u001d\u0003\u001d\u0003\u001d\u0003",
-    "\u001d\u0003\u001d\u0003\u001d\u0003\u001d\u0003\u001d\u0003\u001d\u0003",
-    "\u001e\u0003\u001e\u0003\u001e\u0003\u001e\u0003\u001f\u0003\u001f\u0005",
-    "\u001f\u00fd\n\u001f\u0003 \u0003 \u0007 \u0101\n \f \u000e \u0104\u000b",
-    " \u0003!\u0003!\u0003!\u0003!\u0003\"\u0006\"\u010b\n\"\r\"\u000e\"",
-    "\u010c\u0003\"\u0003\"\u0003\"\u0003\"\u0005\"\u0113\n\"\u0003\"\u0006",
-    "\"\u0116\n\"\r\"\u000e\"\u0117\u0003\"\u0003\"\u0003\"\u0003\"\u0005",
-    "\"\u011e\n\"\u0003\"\u0006\"\u0121\n\"\r\"\u000e\"\u0122\u0005\"\u0125",
-    "\n\"\u0003#\u0006#\u0128\n#\r#\u000e#\u0129\u0003#\u0003#\u0006#\u012e",
-    "\n#\r#\u000e#\u012f\u0003$\u0003$\u0003$\u0007$\u0135\n$\f$\u000e$\u0138",
-    "\u000b$\u0003$\u0003$\u0003%\u0003%\u0003%\u0005%\u013f\n%\u0003%\u0003",
-    "%\u0003&\u0003&\u0003&\u0003&\u0003\'\u0003\'\u0003(\u0003(\u0003(\u0003",
-    "(\u0005(\u014d\n(\u0003(\u0003(\u0005(\u0151\n(\u0003)\u0003)\u0003",
-    ")\u0003)\u0003)\u0003)\u0003)\u0003)\u0003)\u0005)\u015c\n)\u0003*\u0003",
-    "*\u0003*\u0003*\u0003*\u0003*\u0003*\u0003+\u0003+\u0003+\u0003+\u0007",
-    "+\u0169\n+\f+\u000e+\u016c\u000b+\u0003+\u0005+\u016f\n+\u0003+\u0003",
-    "+\u0003+\u0003+\u0003+\u0007+\u0176\n+\f+\u000e+\u0179\u000b+\u0003",
-    "+\u0003+\u0005+\u017d\n+\u0003+\u0003+\u0002\u0002,\u0003\u0003\u0005",
-    "\u0004\u0007\u0005\t\u0006\u000b\u0007\r\b\u000f\t\u0011\n\u0013\u000b",
-    "\u0015\f\u0017\r\u0019\u000e\u001b\u000f\u001d\u0010\u001f\u0011!\u0012",
-    "#\u0013%\u0014\'\u0015)\u0016+\u0017-\u0018/\u00191\u001a3\u001b5\u001c",
-    "7\u00029\u0002;\u001d=\u001e?\u001fA C!E\"G#I$K%M\u0002O\u0002Q\u0002",
-    "S\u0002U&\u0003\u0002\u000b\u001d\u0002$&))00AB^^bb\u0080\u0080\u00a4",
-    "\u00a5\u00a9\u00a9\u00ac\u00ac\u00ae\u00ae\u00b4\u00b5\u00bb\u00bc\u00c2",
-    "\u00c2\u00c4\u00c6\u00c9\u00c9\u00cb\u00cd\u00d5\u00d7\u00dc\u00dc\u00de",
-    "\u00de\u00e2\u00e5\u00e9\u00e9\u00eb\u00ec\u00ef\u00ef\u00f5\u00f7\u00fc",
-    "\u00fc\u00fe\u00fe\u0005\u0002C\\aac|\u0006\u00022;C\\aac|\u0004\u0002",
-    "$$^^\u0004\u0002))^^\u0005\u0002\u000b\f\u000f\u000f\"\"\u0005\u0002",
-    "2;CHch\u0007\u0002ddhhppttvv\u0004\u0002\f\f\u000f\u000f\u0002\u0191",
-    "\u0002\u0003\u0003\u0002\u0002\u0002\u0002\u0005\u0003\u0002\u0002\u0002",
-    "\u0002\u0007\u0003\u0002\u0002\u0002\u0002\t\u0003\u0002\u0002\u0002",
-    "\u0002\u000b\u0003\u0002\u0002\u0002\u0002\r\u0003\u0002\u0002\u0002",
-    "\u0002\u000f\u0003\u0002\u0002\u0002\u0002\u0011\u0003\u0002\u0002\u0002",
-    "\u0002\u0013\u0003\u0002\u0002\u0002\u0002\u0015\u0003\u0002\u0002\u0002",
-    "\u0002\u0017\u0003\u0002\u0002\u0002\u0002\u0019\u0003\u0002\u0002\u0002",
-    "\u0002\u001b\u0003\u0002\u0002\u0002\u0002\u001d\u0003\u0002\u0002\u0002",
-    "\u0002\u001f\u0003\u0002\u0002\u0002\u0002!\u0003\u0002\u0002\u0002",
-    "\u0002#\u0003\u0002\u0002\u0002\u0002%\u0003\u0002\u0002\u0002\u0002",
-    "\'\u0003\u0002\u0002\u0002\u0002)\u0003\u0002\u0002\u0002\u0002+\u0003",
-    "\u0002\u0002\u0002\u0002-\u0003\u0002\u0002\u0002\u0002/\u0003\u0002",
-    "\u0002\u0002\u00021\u0003\u0002\u0002\u0002\u00023\u0003\u0002\u0002",
-    "\u0002\u00025\u0003\u0002\u0002\u0002\u0002;\u0003\u0002\u0002\u0002",
-    "\u0002=\u0003\u0002\u0002\u0002\u0002?\u0003\u0002\u0002\u0002\u0002",
-    "A\u0003\u0002\u0002\u0002\u0002C\u0003\u0002\u0002\u0002\u0002E\u0003",
-    "\u0002\u0002\u0002\u0002G\u0003\u0002\u0002\u0002\u0002I\u0003\u0002",
-    "\u0002\u0002\u0002K\u0003\u0002\u0002\u0002\u0002U\u0003\u0002\u0002",
-    "\u0002\u0003W\u0003\u0002\u0002\u0002\u0005Y\u0003\u0002\u0002\u0002",
-    "\u0007[\u0003\u0002\u0002\u0002\t]\u0003\u0002\u0002\u0002\u000b_\u0003",
-    "\u0002\u0002\u0002\ra\u0003\u0002\u0002\u0002\u000fc\u0003\u0002\u0002",
-    "\u0002\u0011l\u0003\u0002\u0002\u0002\u0013q\u0003\u0002\u0002\u0002",
-    "\u0015w\u0003\u0002\u0002\u0002\u0017~\u0003\u0002\u0002\u0002\u0019",
-    "\u0085\u0003\u0002\u0002\u0002\u001b\u008d\u0003\u0002\u0002\u0002\u001d",
-    "\u0096\u0003\u0002\u0002\u0002\u001f\u009e\u0003\u0002\u0002\u0002!",
-    "\u00a3\u0003\u0002\u0002\u0002#\u00ad\u0003\u0002\u0002\u0002%\u00b3",
-    "\u0003\u0002\u0002\u0002\'\u00ba\u0003\u0002\u0002\u0002)\u00c2\u0003",
-    "\u0002\u0002\u0002+\u00c7\u0003\u0002\u0002\u0002-\u00cc\u0003\u0002",
-    "\u0002\u0002/\u00d1\u0003\u0002\u0002\u00021\u00da\u0003\u0002\u0002",
-    "\u00023\u00dd\u0003\u0002\u0002\u00025\u00e3\u0003\u0002\u0002\u0002",
-    "7\u00e5\u0003\u0002\u0002\u00029\u00eb\u0003\u0002\u0002\u0002;\u00f6",
-    "\u0003\u0002\u0002\u0002=\u00fc\u0003\u0002\u0002\u0002?\u00fe\u0003",
-    "\u0002\u0002\u0002A\u0105\u0003\u0002\u0002\u0002C\u0124\u0003\u0002",
-    "\u0002\u0002E\u0127\u0003\u0002\u0002\u0002G\u0131\u0003\u0002\u0002",
-    "\u0002I\u013b\u0003\u0002\u0002\u0002K\u0142\u0003\u0002\u0002\u0002",
-    "M\u0146\u0003\u0002\u0002\u0002O\u0150\u0003\u0002\u0002\u0002Q\u015b",
-    "\u0003\u0002\u0002\u0002S\u015d\u0003\u0002\u0002\u0002U\u017c\u0003",
-    "\u0002\u0002\u0002WX\u0007}\u0002\u0002X\u0004\u0003\u0002\u0002\u0002",
-    "YZ\u0007\u007f\u0002\u0002Z\u0006\u0003\u0002\u0002\u0002[\\\u0007.",
-    "\u0002\u0002\\\b\u0003\u0002\u0002\u0002]^\u0007]\u0002\u0002^\n\u0003",
-    "\u0002\u0002\u0002_`\u0007_\u0002\u0002`\f\u0003\u0002\u0002\u0002a",
-    "b\u0007?\u0002\u0002b\u000e\u0003\u0002\u0002\u0002cd\u0007r\u0002\u0002",
-    "de\u0007t\u0002\u0002ef\u0007q\u0002\u0002fg\u0007i\u0002\u0002gh\u0007",
-    "t\u0002\u0002hi\u0007c\u0002\u0002ij\u0007o\u0002\u0002jk\u0007c\u0002",
-    "\u0002k\u0010\u0003\u0002\u0002\u0002lm\u0007t\u0002\u0002mn\u0007g",
-    "\u0002\u0002no\u0007c\u0002\u0002op\u0007n\u0002\u0002p\u0012\u0003",
-    "\u0002\u0002\u0002qr\u0007x\u0002\u0002rs\u0007c\u0002\u0002st\u0007",
-    "|\u0002\u0002tu\u0007k\u0002\u0002uv\u0007q\u0002\u0002v\u0014\u0003",
-    "\u0002\u0002\u0002wx\u0007n\u0002\u0002xy\u0007q\u0002\u0002yz\u0007",
-    "i\u0002\u0002z{\u0007k\u0002\u0002{|\u0007e\u0002\u0002|}\u0007q\u0002",
-    "\u0002}\u0016\u0003\u0002\u0002\u0002~\u007f\u0007e\u0002\u0002\u007f",
-    "\u0080\u0007c\u0002\u0002\u0080\u0081\u0007f\u0002\u0002\u0081\u0082",
-    "\u0007g\u0002\u0002\u0082\u0083\u0007k\u0002\u0002\u0083\u0084\u0007",
-    "c\u0002\u0002\u0084\u0018\u0003\u0002\u0002\u0002\u0085\u0086\u0007",
-    "k\u0002\u0002\u0086\u0087\u0007p\u0002\u0002\u0087\u0088\u0007v\u0002",
-    "\u0002\u0088\u0089\u0007g\u0002\u0002\u0089\u008a\u0007k\u0002\u0002",
-    "\u008a\u008b\u0007t\u0002\u0002\u008b\u008c\u0007q\u0002\u0002\u008c",
-    "\u001a\u0003\u0002\u0002\u0002\u008d\u008e\u0007e\u0002\u0002\u008e",
-    "\u008f\u0007c\u0002\u0002\u008f\u0090\u0007t\u0002\u0002\u0090\u0091",
-    "\u0007c\u0002\u0002\u0091\u0092\u0007e\u0002\u0002\u0092\u0093\u0007",
-    "v\u0002\u0002\u0093\u0094\u0007g\u0002\u0002\u0094\u0095\u0007t\u0002",
-    "\u0002\u0095\u001c\u0003\u0002\u0002\u0002\u0096\u0097\u0007g\u0002",
-    "\u0002\u0097\u0098\u0007u\u0002\u0002\u0098\u0099\u0007e\u0002\u0002",
-    "\u0099\u009a\u0007q\u0002\u0002\u009a\u009b\u0007n\u0002\u0002\u009b",
-    "\u009c\u0007j\u0002\u0002\u009c\u009d\u0007c\u0002\u0002\u009d\u001e",
-    "\u0003\u0002\u0002\u0002\u009e\u009f\u0007e\u0002\u0002\u009f\u00a0",
-    "\u0007c\u0002\u0002\u00a0\u00a1\u0007u\u0002\u0002\u00a1\u00a2\u0007",
-    "q\u0002\u0002\u00a2 \u0003\u0002\u0002\u0002\u00a3\u00a4\u0007e\u0002",
-    "\u0002\u00a4\u00a5\u0007q\u0002\u0002\u00a5\u00a6\u0007p\u0002\u0002",
-    "\u00a6\u00a7\u0007v\u0002\u0002\u00a7\u00a8\u0007t\u0002\u0002\u00a8",
-    "\u00a9\u0007c\u0002\u0002\u00a9\u00aa\u0007t\u0002\u0002\u00aa\u00ab",
-    "\u0007k\u0002\u0002\u00ab\u00ac\u0007q\u0002\u0002\u00ac\"\u0003\u0002",
-    "\u0002\u0002\u00ad\u00ae\u0007e\u0002\u0002\u00ae\u00af\u0007q\u0002",
-    "\u0002\u00af\u00b0\u0007p\u0002\u0002\u00b0\u00b1\u0007u\u0002\u0002",
-    "\u00b1\u00b2\u0007v\u0002\u0002\u00b2$\u0003\u0002\u0002\u0002\u00b3",
-    "\u00b4\u0007h\u0002\u0002\u00b4\u00b5\u0007w\u0002\u0002\u00b5\u00b6",
-    "\u0007p\u0002\u0002\u00b6\u00b7\u0007e\u0002\u0002\u00b7\u00b8\u0007",
-    "c\u0002\u0002\u00b8\u00b9\u0007q\u0002\u0002\u00b9&\u0003\u0002\u0002",
-    "\u0002\u00ba\u00bb\u0007t\u0002\u0002\u00bb\u00bc\u0007g\u0002\u0002",
-    "\u00bc\u00bd\u0007v\u0002\u0002\u00bd\u00be\u0007q\u0002\u0002\u00be",
-    "\u00bf\u0007t\u0002\u0002\u00bf\u00c0\u0007p\u0002\u0002\u00c0\u00c1",
-    "\u0007g\u0002\u0002\u00c1(\u0003\u0002\u0002\u0002\u00c2\u00c3\u0007",
-    "r\u0002\u0002\u00c3\u00c4\u0007c\u0002\u0002\u00c4\u00c5\u0007t\u0002",
-    "\u0002\u00c5\u00c6\u0007c\u0002\u0002\u00c6*\u0003\u0002\u0002\u0002",
-    "\u00c7\u00c8\u0007r\u0002\u0002\u00c8\u00c9\u0007c\u0002\u0002\u00c9",
-    "\u00ca\u0007t\u0002\u0002\u00ca\u00cb\u0007g\u0002\u0002\u00cb,\u0003",
-    "\u0002\u0002\u0002\u00cc\u00cd\u0007h\u0002\u0002\u00cd\u00ce\u0007",
-    "c\u0002\u0002\u00ce\u00cf\u0007e\u0002\u0002\u00cf\u00d0\u0007c\u0002",
-    "\u0002\u00d0.\u0003\u0002\u0002\u0002\u00d1\u00d2\u0007g\u0002\u0002",
-    "\u00d2\u00d3\u0007p\u0002\u0002\u00d3\u00d4\u0007s\u0002\u0002\u00d4",
-    "\u00d5\u0007w\u0002\u0002\u00d5\u00d6\u0007c\u0002\u0002\u00d6\u00d7",
-    "\u0007p\u0002\u0002\u00d7\u00d8\u0007v\u0002\u0002\u00d8\u00d9\u0007",
-    "q\u0002\u0002\u00d90\u0003\u0002\u0002\u0002\u00da\u00db\u0007u\u0002",
-    "\u0002\u00db\u00dc\u0007g\u0002\u0002\u00dc2\u0003\u0002\u0002\u0002",
-    "\u00dd\u00de\u0007u\u0002\u0002\u00de\u00df\u0007g\u0002\u0002\u00df",
-    "\u00e0\u0007p\u0002\u0002\u00e0\u00e1\u0007c\u0002\u0002\u00e1\u00e2",
-    "\u0007q\u0002\u0002\u00e24\u0003\u0002\u0002\u0002\u00e3\u00e4\t\u0002",
-    "\u0002\u0002\u00e46\u0003\u0002\u0002\u0002\u00e5\u00e6\u0007h\u0002",
-    "\u0002\u00e6\u00e7\u0007c\u0002\u0002\u00e7\u00e8\u0007n\u0002\u0002",
-    "\u00e8\u00e9\u0007u\u0002\u0002\u00e9\u00ea\u0007q\u0002\u0002\u00ea",
-    "8\u0003\u0002\u0002\u0002\u00eb\u00ec\u0007x\u0002\u0002\u00ec\u00ed",
-    "\u0007g\u0002\u0002\u00ed\u00ee\u0007t\u0002\u0002\u00ee\u00ef\u0007",
-    "f\u0002\u0002\u00ef\u00f0\u0007c\u0002\u0002\u00f0\u00f1\u0007f\u0002",
-    "\u0002\u00f1\u00f2\u0007g\u0002\u0002\u00f2\u00f3\u0007k\u0002\u0002",
-    "\u00f3\u00f4\u0007t\u0002\u0002\u00f4\u00f5\u0007q\u0002\u0002\u00f5",
-    ":\u0003\u0002\u0002\u0002\u00f6\u00f7\u0007p\u0002\u0002\u00f7\u00f8",
-    "\u0007c\u0002\u0002\u00f8\u00f9\u0007q\u0002\u0002\u00f9<\u0003\u0002",
-    "\u0002\u0002\u00fa\u00fd\u00059\u001d\u0002\u00fb\u00fd\u00057\u001c",
-    "\u0002\u00fc\u00fa\u0003\u0002\u0002\u0002\u00fc\u00fb\u0003\u0002\u0002",
-    "\u0002\u00fd>\u0003\u0002\u0002\u0002\u00fe\u0102\t\u0003\u0002\u0002",
-    "\u00ff\u0101\t\u0004\u0002\u0002\u0100\u00ff\u0003\u0002\u0002\u0002",
-    "\u0101\u0104\u0003\u0002\u0002\u0002\u0102\u0100\u0003\u0002\u0002\u0002",
-    "\u0102\u0103\u0003\u0002\u0002\u0002\u0103@\u0003\u0002\u0002\u0002",
-    "\u0104\u0102\u0003\u0002\u0002\u0002\u0105\u0106\u0005? \u0002\u0106",
-    "\u0107\u00070\u0002\u0002\u0107\u0108\u0005? \u0002\u0108B\u0003\u0002",
-    "\u0002\u0002\u0109\u010b\u00042;\u0002\u010a\u0109\u0003\u0002\u0002",
-    "\u0002\u010b\u010c\u0003\u0002\u0002\u0002\u010c\u010a\u0003\u0002\u0002",
-    "\u0002\u010c\u010d\u0003\u0002\u0002\u0002\u010d\u0125\u0003\u0002\u0002",
-    "\u0002\u010e\u010f\u00072\u0002\u0002\u010f\u0113\u0007z\u0002\u0002",
-    "\u0110\u0111\u00072\u0002\u0002\u0111\u0113\u0007Z\u0002\u0002\u0112",
-    "\u010e\u0003\u0002\u0002\u0002\u0112\u0110\u0003\u0002\u0002\u0002\u0113",
-    "\u0115\u0003\u0002\u0002\u0002\u0114\u0116\u0005M\'\u0002\u0115\u0114",
-    "\u0003\u0002\u0002\u0002\u0116\u0117\u0003\u0002\u0002\u0002\u0117\u0115",
-    "\u0003\u0002\u0002\u0002\u0117\u0118\u0003\u0002\u0002\u0002\u0118\u0125",
-    "\u0003\u0002\u0002\u0002\u0119\u011a\u00072\u0002\u0002\u011a\u011e",
-    "\u0007d\u0002\u0002\u011b\u011c\u00072\u0002\u0002\u011c\u011e\u0007",
-    "D\u0002\u0002\u011d\u0119\u0003\u0002\u0002\u0002\u011d\u011b\u0003",
-    "\u0002\u0002\u0002\u011e\u0120\u0003\u0002\u0002\u0002\u011f\u0121\u0004",
-    "23\u0002\u0120\u011f\u0003\u0002\u0002\u0002\u0121\u0122\u0003\u0002",
-    "\u0002\u0002\u0122\u0120\u0003\u0002\u0002\u0002\u0122\u0123\u0003\u0002",
-    "\u0002\u0002\u0123\u0125\u0003\u0002\u0002\u0002\u0124\u010a\u0003\u0002",
-    "\u0002\u0002\u0124\u0112\u0003\u0002\u0002\u0002\u0124\u011d\u0003\u0002",
-    "\u0002\u0002\u0125D\u0003\u0002\u0002\u0002\u0126\u0128\u00042;\u0002",
-    "\u0127\u0126\u0003\u0002\u0002\u0002\u0128\u0129\u0003\u0002\u0002\u0002",
-    "\u0129\u0127\u0003\u0002\u0002\u0002\u0129\u012a\u0003\u0002\u0002\u0002",
-    "\u012a\u012b\u0003\u0002\u0002\u0002\u012b\u012d\u00070\u0002\u0002",
-    "\u012c\u012e\u00042;\u0002\u012d\u012c\u0003\u0002\u0002\u0002\u012e",
-    "\u012f\u0003\u0002\u0002\u0002\u012f\u012d\u0003\u0002\u0002\u0002\u012f",
-    "\u0130\u0003\u0002\u0002\u0002\u0130F\u0003\u0002\u0002\u0002\u0131",
-    "\u0136\u0007$\u0002\u0002\u0132\u0135\u0005O(\u0002\u0133\u0135\n\u0005",
-    "\u0002\u0002\u0134\u0132\u0003\u0002\u0002\u0002\u0134\u0133\u0003\u0002",
-    "\u0002\u0002\u0135\u0138\u0003\u0002\u0002\u0002\u0136\u0134\u0003\u0002",
-    "\u0002\u0002\u0136\u0137\u0003\u0002\u0002\u0002\u0137\u0139\u0003\u0002",
-    "\u0002\u0002\u0138\u0136\u0003\u0002\u0002\u0002\u0139\u013a\u0007$",
-    "\u0002\u0002\u013aH\u0003\u0002\u0002\u0002\u013b\u013e\u0007)\u0002",
-    "\u0002\u013c\u013f\u0005O(\u0002\u013d\u013f\n\u0006\u0002\u0002\u013e",
-    "\u013c\u0003\u0002\u0002\u0002\u013e\u013d\u0003\u0002\u0002\u0002\u013f",
-    "\u0140\u0003\u0002\u0002\u0002\u0140\u0141\u0007)\u0002\u0002\u0141",
-    "J\u0003\u0002\u0002\u0002\u0142\u0143\t\u0007\u0002\u0002\u0143\u0144",
-    "\u0003\u0002\u0002\u0002\u0144\u0145\b&\u0002\u0002\u0145L\u0003\u0002",
-    "\u0002\u0002\u0146\u0147\t\b\u0002\u0002\u0147N\u0003\u0002\u0002\u0002",
-    "\u0148\u014c\u0007^\u0002\u0002\u0149\u014d\t\t\u0002\u0002\u014a\u014d",
-    "\u0003\u0002\u0002\u0002\u014b\u014d\t\u0006\u0002\u0002\u014c\u0149",
-    "\u0003\u0002\u0002\u0002\u014c\u014a\u0003\u0002\u0002\u0002\u014c\u014b",
-    "\u0003\u0002\u0002\u0002\u014d\u0151\u0003\u0002\u0002\u0002\u014e\u0151",
-    "\u0005S*\u0002\u014f\u0151\u0005Q)\u0002\u0150\u0148\u0003\u0002\u0002",
-    "\u0002\u0150\u014e\u0003\u0002\u0002\u0002\u0150\u014f\u0003\u0002\u0002",
-    "\u0002\u0151P\u0003\u0002\u0002\u0002\u0152\u0153\u0007^\u0002\u0002",
-    "\u0153\u0154\u000425\u0002\u0154\u0155\u000429\u0002\u0155\u015c\u0004",
-    "29\u0002\u0156\u0157\u0007^\u0002\u0002\u0157\u0158\u000429\u0002\u0158",
-    "\u015c\u000429\u0002\u0159\u015a\u0007^\u0002\u0002\u015a\u015c\u0004",
-    "29\u0002\u015b\u0152\u0003\u0002\u0002\u0002\u015b\u0156\u0003\u0002",
-    "\u0002\u0002\u015b\u0159\u0003\u0002\u0002\u0002\u015cR\u0003\u0002",
-    "\u0002\u0002\u015d\u015e\u0007^\u0002\u0002\u015e\u015f\u0007w\u0002",
-    "\u0002\u015f\u0160\u0005M\'\u0002\u0160\u0161\u0005M\'\u0002\u0161\u0162",
-    "\u0005M\'\u0002\u0162\u0163\u0005M\'\u0002\u0163T\u0003\u0002\u0002",
-    "\u0002\u0164\u0165\u00071\u0002\u0002\u0165\u0166\u00071\u0002\u0002",
-    "\u0166\u016a\u0003\u0002\u0002\u0002\u0167\u0169\n\n\u0002\u0002\u0168",
-    "\u0167\u0003\u0002\u0002\u0002\u0169\u016c\u0003\u0002\u0002\u0002\u016a",
-    "\u0168\u0003\u0002\u0002\u0002\u016a\u016b\u0003\u0002\u0002\u0002\u016b",
-    "\u016e\u0003\u0002\u0002\u0002\u016c\u016a\u0003\u0002\u0002\u0002\u016d",
-    "\u016f\u0007\u000f\u0002\u0002\u016e\u016d\u0003\u0002\u0002\u0002\u016e",
-    "\u016f\u0003\u0002\u0002\u0002\u016f\u0170\u0003\u0002\u0002\u0002\u0170",
-    "\u017d\u0007\f\u0002\u0002\u0171\u0172\u00071\u0002\u0002\u0172\u0173",
-    "\u0007,\u0002\u0002\u0173\u0177\u0003\u0002\u0002\u0002\u0174\u0176",
-    "\u000b\u0002\u0002\u0002\u0175\u0174\u0003\u0002\u0002\u0002\u0176\u0179",
-    "\u0003\u0002\u0002\u0002\u0177\u0175\u0003\u0002\u0002\u0002\u0177\u0178",
-    "\u0003\u0002\u0002\u0002\u0178\u017a\u0003\u0002\u0002\u0002\u0179\u0177",
-    "\u0003\u0002\u0002\u0002\u017a\u017b\u0007,\u0002\u0002\u017b\u017d",
-    "\u00071\u0002\u0002\u017c\u0164\u0003\u0002\u0002\u0002\u017c\u0171",
-    "\u0003\u0002\u0002\u0002\u017d\u017e\u0003\u0002\u0002\u0002\u017e\u017f",
-    "\b+\u0002\u0002\u017fV\u0003\u0002\u0002\u0002\u0017\u0002\u00fc\u0102",
-    "\u010c\u0112\u0117\u011d\u0122\u0124\u0129\u012f\u0134\u0136\u013e\u014c",
-    "\u0150\u015b\u016a\u016e\u0177\u017c\u0003\b\u0002\u0002"].join("");
-
-
-var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
-
-var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });
-
-function ivprogLexer(input) {
-	antlr4.Lexer.call(this, input);
-    this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
-    return this;
-}
-
-ivprogLexer.prototype = Object.create(antlr4.Lexer.prototype);
-ivprogLexer.prototype.constructor = ivprogLexer;
-
-Object.defineProperty(ivprogLexer.prototype, "atn", {
-        get : function() {
-                return atn;
-        }
-});
-
-ivprogLexer.EOF = antlr4.Token.EOF;
-ivprogLexer.T__0 = 1;
-ivprogLexer.T__1 = 2;
-ivprogLexer.T__2 = 3;
-ivprogLexer.T__3 = 4;
-ivprogLexer.T__4 = 5;
-ivprogLexer.T__5 = 6;
-ivprogLexer.PR_PROGRAMA = 7;
-ivprogLexer.PR_REAL = 8;
-ivprogLexer.PR_VAZIO = 9;
-ivprogLexer.PR_LOGICO = 10;
-ivprogLexer.PR_CADEIA = 11;
-ivprogLexer.PR_INTEIRO = 12;
-ivprogLexer.PR_CARACTER = 13;
-ivprogLexer.PR_ESCOLHA = 14;
-ivprogLexer.PR_CASO = 15;
-ivprogLexer.PR_CONTRARIO = 16;
-ivprogLexer.PR_CONST = 17;
-ivprogLexer.PR_FUNCAO = 18;
-ivprogLexer.PR_RETORNE = 19;
-ivprogLexer.PR_PARA = 20;
-ivprogLexer.PR_PARE = 21;
-ivprogLexer.PR_FACA = 22;
-ivprogLexer.PR_ENQUANTO = 23;
-ivprogLexer.PR_SE = 24;
-ivprogLexer.PR_SENAO = 25;
-ivprogLexer.GAMBIARRA = 26;
-ivprogLexer.OPERADOR_NAO = 27;
-ivprogLexer.LOGICO = 28;
-ivprogLexer.ID = 29;
-ivprogLexer.ID_BIBLIOTECA = 30;
-ivprogLexer.INTEIRO = 31;
-ivprogLexer.REAL = 32;
-ivprogLexer.CADEIA = 33;
-ivprogLexer.CARACTER = 34;
-ivprogLexer.ESPACO = 35;
-ivprogLexer.COMENTARIO = 36;
-
-ivprogLexer.prototype.channelNames = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" ];
-
-ivprogLexer.prototype.modeNames = [ "DEFAULT_MODE" ];
-
-ivprogLexer.prototype.literalNames = [ null, "'{'", "'}'", "','", "'['", 
-                                       "']'", "'='", "'programa'", "'real'", 
-                                       "'vazio'", "'logico'", "'cadeia'", 
-                                       "'inteiro'", "'caracter'", "'escolha'", 
-                                       "'caso'", "'contrario'", "'const'", 
-                                       "'funcao'", "'retorne'", "'para'", 
-                                       "'pare'", "'faca'", "'enquanto'", 
-                                       "'se'", "'senao'", null, "'nao'" ];
-
-ivprogLexer.prototype.symbolicNames = [ null, null, null, null, null, null, 
-                                        null, "PR_PROGRAMA", "PR_REAL", 
-                                        "PR_VAZIO", "PR_LOGICO", "PR_CADEIA", 
-                                        "PR_INTEIRO", "PR_CARACTER", "PR_ESCOLHA", 
-                                        "PR_CASO", "PR_CONTRARIO", "PR_CONST", 
-                                        "PR_FUNCAO", "PR_RETORNE", "PR_PARA", 
-                                        "PR_PARE", "PR_FACA", "PR_ENQUANTO", 
-                                        "PR_SE", "PR_SENAO", "GAMBIARRA", 
-                                        "OPERADOR_NAO", "LOGICO", "ID", 
-                                        "ID_BIBLIOTECA", "INTEIRO", "REAL", 
-                                        "CADEIA", "CARACTER", "ESPACO", 
-                                        "COMENTARIO" ];
-
-ivprogLexer.prototype.ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", 
-                                    "T__5", "PR_PROGRAMA", "PR_REAL", "PR_VAZIO", 
-                                    "PR_LOGICO", "PR_CADEIA", "PR_INTEIRO", 
-                                    "PR_CARACTER", "PR_ESCOLHA", "PR_CASO", 
-                                    "PR_CONTRARIO", "PR_CONST", "PR_FUNCAO", 
-                                    "PR_RETORNE", "PR_PARA", "PR_PARE", 
-                                    "PR_FACA", "PR_ENQUANTO", "PR_SE", "PR_SENAO", 
-                                    "GAMBIARRA", "PR_FALSO", "PR_VERDADEIRO", 
-                                    "OPERADOR_NAO", "LOGICO", "ID", "ID_BIBLIOTECA", 
-                                    "INTEIRO", "REAL", "CADEIA", "CARACTER", 
-                                    "ESPACO", "DIGIT_HEX", "SEQ_ESC", "ESC_OCTAL", 
-                                    "ESC_UNICODE", "COMENTARIO" ];
-
-ivprogLexer.prototype.grammarFileName = "ivprog.g4";
-
-
-
-exports.ivprogLexer = ivprogLexer;
-

+ 0 - 62
grammar/ivprogLexer.tokens

@@ -1,62 +0,0 @@
-T__0=1
-T__1=2
-T__2=3
-T__3=4
-T__4=5
-T__5=6
-PR_PROGRAMA=7
-PR_REAL=8
-PR_VAZIO=9
-PR_LOGICO=10
-PR_CADEIA=11
-PR_INTEIRO=12
-PR_CARACTER=13
-PR_ESCOLHA=14
-PR_CASO=15
-PR_CONTRARIO=16
-PR_CONST=17
-PR_FUNCAO=18
-PR_RETORNE=19
-PR_PARA=20
-PR_PARE=21
-PR_FACA=22
-PR_ENQUANTO=23
-PR_SE=24
-PR_SENAO=25
-GAMBIARRA=26
-OPERADOR_NAO=27
-LOGICO=28
-ID=29
-ID_BIBLIOTECA=30
-INTEIRO=31
-REAL=32
-CADEIA=33
-CARACTER=34
-ESPACO=35
-COMENTARIO=36
-'{'=1
-'}'=2
-','=3
-'['=4
-']'=5
-'='=6
-'programa'=7
-'real'=8
-'vazio'=9
-'logico'=10
-'cadeia'=11
-'inteiro'=12
-'caracter'=13
-'escolha'=14
-'caso'=15
-'contrario'=16
-'const'=17
-'funcao'=18
-'retorne'=19
-'para'=20
-'pare'=21
-'faca'=22
-'enquanto'=23
-'se'=24
-'senao'=25
-'nao'=27

+ 0 - 78
grammar/ivprogListener.js

@@ -1,78 +0,0 @@
-// Generated from grammar/ivprog.g4 by ANTLR 4.7.1
-// jshint ignore: start
-var antlr4 = require('antlr4/index');
-
-// This class defines a complete listener for a parse tree produced by ivprogParser.
-function ivprogListener() {
-	antlr4.tree.ParseTreeListener.call(this);
-	return this;
-}
-
-ivprogListener.prototype = Object.create(antlr4.tree.ParseTreeListener.prototype);
-ivprogListener.prototype.constructor = ivprogListener;
-
-// Enter a parse tree produced by ivprogParser#parse.
-ivprogListener.prototype.enterParse = function(ctx) {
-};
-
-// Exit a parse tree produced by ivprogParser#parse.
-ivprogListener.prototype.exitParse = function(ctx) {
-};
-
-
-// Enter a parse tree produced by ivprogParser#programa.
-ivprogListener.prototype.enterPrograma = function(ctx) {
-};
-
-// Exit a parse tree produced by ivprogParser#programa.
-ivprogListener.prototype.exitPrograma = function(ctx) {
-};
-
-
-// Enter a parse tree produced by ivprogParser#declaracoesGlobais.
-ivprogListener.prototype.enterDeclaracoesGlobais = function(ctx) {
-};
-
-// Exit a parse tree produced by ivprogParser#declaracoesGlobais.
-ivprogListener.prototype.exitDeclaracoesGlobais = function(ctx) {
-};
-
-
-// Enter a parse tree produced by ivprogParser#listaDeclaracoes.
-ivprogListener.prototype.enterListaDeclaracoes = function(ctx) {
-};
-
-// Exit a parse tree produced by ivprogParser#listaDeclaracoes.
-ivprogListener.prototype.exitListaDeclaracoes = function(ctx) {
-};
-
-
-// Enter a parse tree produced by ivprogParser#declaracao.
-ivprogListener.prototype.enterDeclaracao = function(ctx) {
-};
-
-// Exit a parse tree produced by ivprogParser#declaracao.
-ivprogListener.prototype.exitDeclaracao = function(ctx) {
-};
-
-
-// Enter a parse tree produced by ivprogParser#declaracaoTipoDado.
-ivprogListener.prototype.enterDeclaracaoTipoDado = function(ctx) {
-};
-
-// Exit a parse tree produced by ivprogParser#declaracaoTipoDado.
-ivprogListener.prototype.exitDeclaracaoTipoDado = function(ctx) {
-};
-
-
-// Enter a parse tree produced by ivprogParser#expressao.
-ivprogListener.prototype.enterExpressao = function(ctx) {
-};
-
-// Exit a parse tree produced by ivprogParser#expressao.
-ivprogListener.prototype.exitExpressao = function(ctx) {
-};
-
-
-
-exports.ivprogListener = ivprogListener;

+ 0 - 837
grammar/ivprogParser.js

@@ -1,837 +0,0 @@
-// Generated from grammar/ivprog.g4 by ANTLR 4.7.1
-// jshint ignore: start
-var antlr4 = require('antlr4/index');
-var ivprogListener = require('./ivprogListener').ivprogListener;
-
-  import {ASA, NoGlobal} from '../js/asa';
-
-var grammarFileName = "ivprog.g4";
-
-var serializedATN = ["\u0003\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964",
-    "\u0003&S\u0004\u0002\t\u0002\u0004\u0003\t\u0003\u0004\u0004\t\u0004",
-    "\u0004\u0005\t\u0005\u0004\u0006\t\u0006\u0004\u0007\t\u0007\u0004\b",
-    "\t\b\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0003\u0003",
-    "\u0003\u0003\u0003\u0003\u0003\u0007\u0003\u0019\n\u0003\f\u0003\u000e",
-    "\u0003\u001c\u000b\u0003\u0003\u0003\u0003\u0003\u0003\u0004\u0003\u0004",
-    "\u0003\u0004\u0003\u0005\u0005\u0005$\n\u0005\u0003\u0005\u0003\u0005",
-    "\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0005",
-    "\u0007\u0005.\n\u0005\f\u0005\u000e\u00051\u000b\u0005\u0003\u0006\u0003",
-    "\u0006\u0003\u0006\u0005\u00066\n\u0006\u0003\u0006\u0003\u0006\u0003",
-    "\u0006\u0005\u0006;\n\u0006\u0003\u0006\u0005\u0006>\n\u0006\u0005\u0006",
-    "@\n\u0006\u0003\u0006\u0003\u0006\u0005\u0006D\n\u0006\u0003\u0006\u0003",
-    "\u0006\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0005",
-    "\u0007M\n\u0007\u0003\u0007\u0003\u0007\u0003\b\u0003\b\u0003\b\u0002",
-    "\u0002\t\u0002\u0004\u0006\b\n\f\u000e\u0002\u0003\u0004\u0002!!##\u0002",
-    "W\u0002\u0010\u0003\u0002\u0002\u0002\u0004\u0014\u0003\u0002\u0002",
-    "\u0002\u0006\u001f\u0003\u0002\u0002\u0002\b#\u0003\u0002\u0002\u0002",
-    "\n2\u0003\u0002\u0002\u0002\fL\u0003\u0002\u0002\u0002\u000eP\u0003",
-    "\u0002\u0002\u0002\u0010\u0011\u0005\u0004\u0003\u0002\u0011\u0012\u0007",
-    "\u0002\u0002\u0003\u0012\u0013\b\u0002\u0001\u0002\u0013\u0003\u0003",
-    "\u0002\u0002\u0002\u0014\u0015\u0007\t\u0002\u0002\u0015\u0016\u0007",
-    "\u0003\u0002\u0002\u0016\u001a\b\u0003\u0001\u0002\u0017\u0019\u0005",
-    "\u0006\u0004\u0002\u0018\u0017\u0003\u0002\u0002\u0002\u0019\u001c\u0003",
-    "\u0002\u0002\u0002\u001a\u0018\u0003\u0002\u0002\u0002\u001a\u001b\u0003",
-    "\u0002\u0002\u0002\u001b\u001d\u0003\u0002\u0002\u0002\u001c\u001a\u0003",
-    "\u0002\u0002\u0002\u001d\u001e\u0007\u0004\u0002\u0002\u001e\u0005\u0003",
-    "\u0002\u0002\u0002\u001f \u0005\b\u0005\u0002 !\b\u0004\u0001\u0002",
-    "!\u0007\u0003\u0002\u0002\u0002\"$\u0007\u0013\u0002\u0002#\"\u0003",
-    "\u0002\u0002\u0002#$\u0003\u0002\u0002\u0002$%\u0003\u0002\u0002\u0002",
-    "%&\u0005\f\u0007\u0002&\'\u0005\n\u0006\u0002\'(\b\u0005\u0001\u0002",
-    "(/\u0003\u0002\u0002\u0002)*\u0007\u0005\u0002\u0002*+\u0005\n\u0006",
-    "\u0002+,\b\u0005\u0001\u0002,.\u0003\u0002\u0002\u0002-)\u0003\u0002",
-    "\u0002\u0002.1\u0003\u0002\u0002\u0002/-\u0003\u0002\u0002\u0002/0\u0003",
-    "\u0002\u0002\u00020\t\u0003\u0002\u0002\u00021/\u0003\u0002\u0002\u0002",
-    "2?\u0007\u001f\u0002\u000235\u0007\u0006\u0002\u000246\u0005\u000e\b",
-    "\u000254\u0003\u0002\u0002\u000256\u0003\u0002\u0002\u000267\u0003\u0002",
-    "\u0002\u00027=\u0007\u0007\u0002\u00028:\u0007\u0006\u0002\u00029;\u0005",
-    "\u000e\b\u0002:9\u0003\u0002\u0002\u0002:;\u0003\u0002\u0002\u0002;",
-    "<\u0003\u0002\u0002\u0002<>\u0007\u0007\u0002\u0002=8\u0003\u0002\u0002",
-    "\u0002=>\u0003\u0002\u0002\u0002>@\u0003\u0002\u0002\u0002?3\u0003\u0002",
-    "\u0002\u0002?@\u0003\u0002\u0002\u0002@C\u0003\u0002\u0002\u0002AB\u0007",
-    "\b\u0002\u0002BD\u0005\u000e\b\u0002CA\u0003\u0002\u0002\u0002CD\u0003",
-    "\u0002\u0002\u0002DE\u0003\u0002\u0002\u0002EF\b\u0006\u0001\u0002F",
-    "\u000b\u0003\u0002\u0002\u0002GM\u0007\u000e\u0002\u0002HM\u0007\n\u0002",
-    "\u0002IM\u0007\u000f\u0002\u0002JM\u0007\r\u0002\u0002KM\u0007\f\u0002",
-    "\u0002LG\u0003\u0002\u0002\u0002LH\u0003\u0002\u0002\u0002LI\u0003\u0002",
-    "\u0002\u0002LJ\u0003\u0002\u0002\u0002LK\u0003\u0002\u0002\u0002MN\u0003",
-    "\u0002\u0002\u0002NO\b\u0007\u0001\u0002O\r\u0003\u0002\u0002\u0002",
-    "PQ\t\u0002\u0002\u0002Q\u000f\u0003\u0002\u0002\u0002\u000b\u001a#/",
-    "5:=?CL"].join("");
-
-
-var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
-
-var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });
-
-var sharedContextCache = new antlr4.PredictionContextCache();
-
-var literalNames = [ null, "'{'", "'}'", "','", "'['", "']'", "'='", "'programa'", 
-                     "'real'", "'vazio'", "'logico'", "'cadeia'", "'inteiro'", 
-                     "'caracter'", "'escolha'", "'caso'", "'contrario'", 
-                     "'const'", "'funcao'", "'retorne'", "'para'", "'pare'", 
-                     "'faca'", "'enquanto'", "'se'", "'senao'", null, "'nao'" ];
-
-var symbolicNames = [ null, null, null, null, null, null, null, "PR_PROGRAMA", 
-                      "PR_REAL", "PR_VAZIO", "PR_LOGICO", "PR_CADEIA", "PR_INTEIRO", 
-                      "PR_CARACTER", "PR_ESCOLHA", "PR_CASO", "PR_CONTRARIO", 
-                      "PR_CONST", "PR_FUNCAO", "PR_RETORNE", "PR_PARA", 
-                      "PR_PARE", "PR_FACA", "PR_ENQUANTO", "PR_SE", "PR_SENAO", 
-                      "GAMBIARRA", "OPERADOR_NAO", "LOGICO", "ID", "ID_BIBLIOTECA", 
-                      "INTEIRO", "REAL", "CADEIA", "CARACTER", "ESPACO", 
-                      "COMENTARIO" ];
-
-var ruleNames =  [ "parse", "programa", "declaracoesGlobais", "listaDeclaracoes", 
-                   "declaracao", "declaracaoTipoDado", "expressao" ];
-
-function ivprogParser (input) {
-	antlr4.Parser.call(this, input);
-    this._interp = new antlr4.atn.ParserATNSimulator(this, atn, decisionsToDFA, sharedContextCache);
-    this.ruleNames = ruleNames;
-    this.literalNames = literalNames;
-    this.symbolicNames = symbolicNames;
-
-	  this.criarTrechoCodigoFonte = function(tokenAntlr)
-	    {
-	      if (tokenAntlr != null)
-	      {
-	        const linha = tokenAntlr.getLine();
-	        const coluna = tokenAntlr.getCharPositionInLine();
-	        const tamanhoTexto = tokenAntlr.getText().length();
-	        
-	        return {linha: linha, coluna: coluna, tamanhoTexto: tamanhoTexto};
-	      }
-	      
-	      return null;
-	  }
-
-    return this;
-}
-
-ivprogParser.prototype = Object.create(antlr4.Parser.prototype);
-ivprogParser.prototype.constructor = ivprogParser;
-
-Object.defineProperty(ivprogParser.prototype, "atn", {
-	get : function() {
-		return atn;
-	}
-});
-
-ivprogParser.EOF = antlr4.Token.EOF;
-ivprogParser.T__0 = 1;
-ivprogParser.T__1 = 2;
-ivprogParser.T__2 = 3;
-ivprogParser.T__3 = 4;
-ivprogParser.T__4 = 5;
-ivprogParser.T__5 = 6;
-ivprogParser.PR_PROGRAMA = 7;
-ivprogParser.PR_REAL = 8;
-ivprogParser.PR_VAZIO = 9;
-ivprogParser.PR_LOGICO = 10;
-ivprogParser.PR_CADEIA = 11;
-ivprogParser.PR_INTEIRO = 12;
-ivprogParser.PR_CARACTER = 13;
-ivprogParser.PR_ESCOLHA = 14;
-ivprogParser.PR_CASO = 15;
-ivprogParser.PR_CONTRARIO = 16;
-ivprogParser.PR_CONST = 17;
-ivprogParser.PR_FUNCAO = 18;
-ivprogParser.PR_RETORNE = 19;
-ivprogParser.PR_PARA = 20;
-ivprogParser.PR_PARE = 21;
-ivprogParser.PR_FACA = 22;
-ivprogParser.PR_ENQUANTO = 23;
-ivprogParser.PR_SE = 24;
-ivprogParser.PR_SENAO = 25;
-ivprogParser.GAMBIARRA = 26;
-ivprogParser.OPERADOR_NAO = 27;
-ivprogParser.LOGICO = 28;
-ivprogParser.ID = 29;
-ivprogParser.ID_BIBLIOTECA = 30;
-ivprogParser.INTEIRO = 31;
-ivprogParser.REAL = 32;
-ivprogParser.CADEIA = 33;
-ivprogParser.CARACTER = 34;
-ivprogParser.ESPACO = 35;
-ivprogParser.COMENTARIO = 36;
-
-ivprogParser.RULE_parse = 0;
-ivprogParser.RULE_programa = 1;
-ivprogParser.RULE_declaracoesGlobais = 2;
-ivprogParser.RULE_listaDeclaracoes = 3;
-ivprogParser.RULE_declaracao = 4;
-ivprogParser.RULE_declaracaoTipoDado = 5;
-ivprogParser.RULE_expressao = 6;
-
-function ParseContext(parser, parent, invokingState) {
-	if(parent===undefined) {
-	    parent = null;
-	}
-	if(invokingState===undefined || invokingState===null) {
-		invokingState = -1;
-	}
-	antlr4.ParserRuleContext.call(this, parent, invokingState);
-    this.parser = parser;
-    this.ruleIndex = ivprogParser.RULE_parse;
-    this.asa = null
-    this.prog = null; // ProgramaContext
-    return this;
-}
-
-ParseContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
-ParseContext.prototype.constructor = ParseContext;
-
-ParseContext.prototype.EOF = function() {
-    return this.getToken(ivprogParser.EOF, 0);
-};
-
-ParseContext.prototype.programa = function() {
-    return this.getTypedRuleContext(ProgramaContext,0);
-};
-
-ParseContext.prototype.enterRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.enterParse(this);
-	}
-};
-
-ParseContext.prototype.exitRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.exitParse(this);
-	}
-};
-
-
-
-
-ivprogParser.ParseContext = ParseContext;
-
-ivprogParser.prototype.parse = function() {
-
-    var localctx = new ParseContext(this, this._ctx, this.state);
-    this.enterRule(localctx, 0, ivprogParser.RULE_parse);
-    try {
-        this.enterOuterAlt(localctx, 1);
-        this.state = 14;
-        localctx.prog = this.programa();
-        this.state = 15;
-        this.match(ivprogParser.EOF);
-
-            localctx.asa =  localctx.prog.asa
-          
-    } catch (re) {
-    	if(re instanceof antlr4.error.RecognitionException) {
-	        localctx.exception = re;
-	        this._errHandler.reportError(this, re);
-	        this._errHandler.recover(this, re);
-	    } else {
-	    	throw re;
-	    }
-    } finally {
-        this.exitRule();
-    }
-    return localctx;
-};
-
-function ProgramaContext(parser, parent, invokingState) {
-	if(parent===undefined) {
-	    parent = null;
-	}
-	if(invokingState===undefined || invokingState===null) {
-		invokingState = -1;
-	}
-	antlr4.ParserRuleContext.call(this, parent, invokingState);
-    this.parser = parser;
-    this.ruleIndex = ivprogParser.RULE_programa;
-    this.asa = null
-    return this;
-}
-
-ProgramaContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
-ProgramaContext.prototype.constructor = ProgramaContext;
-
-ProgramaContext.prototype.PR_PROGRAMA = function() {
-    return this.getToken(ivprogParser.PR_PROGRAMA, 0);
-};
-
-ProgramaContext.prototype.declaracoesGlobais = function(i) {
-    if(i===undefined) {
-        i = null;
-    }
-    if(i===null) {
-        return this.getTypedRuleContexts(DeclaracoesGlobaisContext);
-    } else {
-        return this.getTypedRuleContext(DeclaracoesGlobaisContext,i);
-    }
-};
-
-ProgramaContext.prototype.enterRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.enterPrograma(this);
-	}
-};
-
-ProgramaContext.prototype.exitRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.exitPrograma(this);
-	}
-};
-
-
-
-
-ivprogParser.ProgramaContext = ProgramaContext;
-
-ivprogParser.prototype.programa = function() {
-
-    var localctx = new ProgramaContext(this, this._ctx, this.state);
-    this.enterRule(localctx, 2, ivprogParser.RULE_programa);
-    var _la = 0; // Token type
-    try {
-        this.enterOuterAlt(localctx, 1);
-        this.state = 18;
-        this.match(ivprogParser.PR_PROGRAMA);
-        this.state = 19;
-        this.match(ivprogParser.T__0);
-
-              localctx.asa =  new ASA()
-            
-        this.state = 24;
-        this._errHandler.sync(this);
-        _la = this._input.LA(1);
-        while((((_la) & ~0x1f) == 0 && ((1 << _la) & ((1 << ivprogParser.PR_REAL) | (1 << ivprogParser.PR_LOGICO) | (1 << ivprogParser.PR_CADEIA) | (1 << ivprogParser.PR_INTEIRO) | (1 << ivprogParser.PR_CARACTER) | (1 << ivprogParser.PR_CONST))) !== 0)) {
-            this.state = 21;
-            this.declaracoesGlobais(localctx.asa);
-            this.state = 26;
-            this._errHandler.sync(this);
-            _la = this._input.LA(1);
-        }
-        this.state = 27;
-        this.match(ivprogParser.T__1);
-    } catch (re) {
-    	if(re instanceof antlr4.error.RecognitionException) {
-	        localctx.exception = re;
-	        this._errHandler.reportError(this, re);
-	        this._errHandler.recover(this, re);
-	    } else {
-	    	throw re;
-	    }
-    } finally {
-        this.exitRule();
-    }
-    return localctx;
-};
-
-function DeclaracoesGlobaisContext(parser, parent, invokingState, asa) {
-	if(parent===undefined) {
-	    parent = null;
-	}
-	if(invokingState===undefined || invokingState===null) {
-		invokingState = -1;
-	}
-	antlr4.ParserRuleContext.call(this, parent, invokingState);
-    this.parser = parser;
-    this.ruleIndex = ivprogParser.RULE_declaracoesGlobais;
-    this.asa = null
-    this.vList = null; // ListaDeclaracoesContext
-    this.asa = asa || null;
-    return this;
-}
-
-DeclaracoesGlobaisContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
-DeclaracoesGlobaisContext.prototype.constructor = DeclaracoesGlobaisContext;
-
-DeclaracoesGlobaisContext.prototype.listaDeclaracoes = function() {
-    return this.getTypedRuleContext(ListaDeclaracoesContext,0);
-};
-
-DeclaracoesGlobaisContext.prototype.enterRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.enterDeclaracoesGlobais(this);
-	}
-};
-
-DeclaracoesGlobaisContext.prototype.exitRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.exitDeclaracoesGlobais(this);
-	}
-};
-
-
-
-
-ivprogParser.DeclaracoesGlobaisContext = DeclaracoesGlobaisContext;
-
-ivprogParser.prototype.declaracoesGlobais = function(asa) {
-
-    var localctx = new DeclaracoesGlobaisContext(this, this._ctx, this.state, asa);
-    this.enterRule(localctx, 4, ivprogParser.RULE_declaracoesGlobais);
-    try {
-        this.enterOuterAlt(localctx, 1);
-        this.state = 29;
-        localctx.vList = this.listaDeclaracoes();
-
-            if (localctx.asa != null) {
-              this.globais = new NoGlobal();
-              localctx.vList.lista.forEach( v => this.globais.addDeclaracao(v));
-              localctx.asa.nos.push(localctx.vList.lista);
-            }
-          
-    } catch (re) {
-    	if(re instanceof antlr4.error.RecognitionException) {
-	        localctx.exception = re;
-	        this._errHandler.reportError(this, re);
-	        this._errHandler.recover(this, re);
-	    } else {
-	    	throw re;
-	    }
-    } finally {
-        this.exitRule();
-    }
-    return localctx;
-};
-
-function ListaDeclaracoesContext(parser, parent, invokingState) {
-	if(parent===undefined) {
-	    parent = null;
-	}
-	if(invokingState===undefined || invokingState===null) {
-		invokingState = -1;
-	}
-	antlr4.ParserRuleContext.call(this, parent, invokingState);
-    this.parser = parser;
-    this.ruleIndex = ivprogParser.RULE_listaDeclaracoes;
-    this.lista = null
-    this.tokenConst = null; // Token
-    this.informacaoTipoDado = null; // DeclaracaoTipoDadoContext
-    this.vDeclaracao = null; // DeclaracaoContext
-    return this;
-}
-
-ListaDeclaracoesContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
-ListaDeclaracoesContext.prototype.constructor = ListaDeclaracoesContext;
-
-ListaDeclaracoesContext.prototype.declaracaoTipoDado = function() {
-    return this.getTypedRuleContext(DeclaracaoTipoDadoContext,0);
-};
-
-ListaDeclaracoesContext.prototype.declaracao = function(i) {
-    if(i===undefined) {
-        i = null;
-    }
-    if(i===null) {
-        return this.getTypedRuleContexts(DeclaracaoContext);
-    } else {
-        return this.getTypedRuleContext(DeclaracaoContext,i);
-    }
-};
-
-ListaDeclaracoesContext.prototype.PR_CONST = function() {
-    return this.getToken(ivprogParser.PR_CONST, 0);
-};
-
-ListaDeclaracoesContext.prototype.enterRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.enterListaDeclaracoes(this);
-	}
-};
-
-ListaDeclaracoesContext.prototype.exitRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.exitListaDeclaracoes(this);
-	}
-};
-
-
-
-
-ivprogParser.ListaDeclaracoesContext = ListaDeclaracoesContext;
-
-ivprogParser.prototype.listaDeclaracoes = function() {
-
-    var localctx = new ListaDeclaracoesContext(this, this._ctx, this.state);
-    this.enterRule(localctx, 6, ivprogParser.RULE_listaDeclaracoes);
-
-      localctx.lista =  []
-
-    var _la = 0; // Token type
-    try {
-        this.enterOuterAlt(localctx, 1);
-        this.state = 33;
-        this._errHandler.sync(this);
-        _la = this._input.LA(1);
-        if(_la===ivprogParser.PR_CONST) {
-            this.state = 32;
-            localctx.tokenConst = this.match(ivprogParser.PR_CONST);
-        }
-
-        this.state = 35;
-        localctx.informacaoTipoDado = this.declaracaoTipoDado();
-
-        this.state = 36;
-        localctx.vDeclaracao = this.declaracao(localctx.tokenConst, localctx.informacaoTipoDado.informacaoTipoDado);
-
-              if(localctx.vDeclaracao) {
-                localctx.lista.push(localctx.vDeclaracao.rDeclaracao);
-              }
-              localctx.vDeclaracao = null;
-            
-        this.state = 45;
-        this._errHandler.sync(this);
-        _la = this._input.LA(1);
-        while(_la===ivprogParser.T__2) {
-            this.state = 39;
-            this.match(ivprogParser.T__2);
-            this.state = 40;
-            localctx.vDeclaracao = this.declaracao(localctx.tokenConst, localctx.informacaoTipoDado.informacaoTipoDado);
-
-                  if(localctx.vDeclaracao) {
-                    localctx.lista.push(localctx.vDeclaracao.rDeclaracao);
-                  }
-                  localctx.vDeclaracao = null;
-                
-            this.state = 47;
-            this._errHandler.sync(this);
-            _la = this._input.LA(1);
-        }
-    } catch (re) {
-    	if(re instanceof antlr4.error.RecognitionException) {
-	        localctx.exception = re;
-	        this._errHandler.reportError(this, re);
-	        this._errHandler.recover(this, re);
-	    } else {
-	    	throw re;
-	    }
-    } finally {
-        this.exitRule();
-    }
-    return localctx;
-};
-
-function DeclaracaoContext(parser, parent, invokingState, tokenConst, informacaoTipoDado) {
-	if(parent===undefined) {
-	    parent = null;
-	}
-	if(invokingState===undefined || invokingState===null) {
-		invokingState = -1;
-	}
-	antlr4.ParserRuleContext.call(this, parent, invokingState);
-    this.parser = parser;
-    this.ruleIndex = ivprogParser.RULE_declaracao;
-    this.tokenConst = null
-    this.informacaoTipoDado = null
-    this.rDeclaracao = null
-    this._ID = null; // Token
-    this.tk1 = null; // Token
-    this.ind1 = null; // ExpressaoContext
-    this.tk2 = null; // Token
-    this.ind2 = null; // ExpressaoContext
-    this.inicializacao = null; // ExpressaoContext
-    this.tokenConst = tokenConst || null;
-    this.informacaoTipoDado = informacaoTipoDado || null;
-    return this;
-}
-
-DeclaracaoContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
-DeclaracaoContext.prototype.constructor = DeclaracaoContext;
-
-DeclaracaoContext.prototype.ID = function() {
-    return this.getToken(ivprogParser.ID, 0);
-};
-
-DeclaracaoContext.prototype.expressao = function(i) {
-    if(i===undefined) {
-        i = null;
-    }
-    if(i===null) {
-        return this.getTypedRuleContexts(ExpressaoContext);
-    } else {
-        return this.getTypedRuleContext(ExpressaoContext,i);
-    }
-};
-
-DeclaracaoContext.prototype.enterRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.enterDeclaracao(this);
-	}
-};
-
-DeclaracaoContext.prototype.exitRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.exitDeclaracao(this);
-	}
-};
-
-
-
-
-ivprogParser.DeclaracaoContext = DeclaracaoContext;
-
-ivprogParser.prototype.declaracao = function(tokenConst, informacaoTipoDado) {
-
-    var localctx = new DeclaracaoContext(this, this._ctx, this.state, tokenConst, informacaoTipoDado);
-    this.enterRule(localctx, 8, ivprogParser.RULE_declaracao);
-    var _la = 0; // Token type
-    try {
-        this.enterOuterAlt(localctx, 1);
-        this.state = 48;
-        localctx._ID = this.match(ivprogParser.ID);
-        this.state = 61;
-        this._errHandler.sync(this);
-        _la = this._input.LA(1);
-        if(_la===ivprogParser.T__3) {
-            this.state = 49;
-            localctx.tk1 = this.match(ivprogParser.T__3);
-            this.state = 51;
-            this._errHandler.sync(this);
-            _la = this._input.LA(1);
-            if(_la===ivprogParser.INTEIRO || _la===ivprogParser.CADEIA) {
-                this.state = 50;
-                localctx.ind1 = this.expressao();
-            }
-
-            this.state = 53;
-            this.match(ivprogParser.T__4);
-            this.state = 59;
-            this._errHandler.sync(this);
-            _la = this._input.LA(1);
-            if(_la===ivprogParser.T__3) {
-                this.state = 54;
-                localctx.tk2 = this.match(ivprogParser.T__3);
-                this.state = 56;
-                this._errHandler.sync(this);
-                _la = this._input.LA(1);
-                if(_la===ivprogParser.INTEIRO || _la===ivprogParser.CADEIA) {
-                    this.state = 55;
-                    localctx.ind2 = this.expressao();
-                }
-
-                this.state = 58;
-                this.match(ivprogParser.T__4);
-            }
-
-        }
-
-        this.state = 65;
-        this._errHandler.sync(this);
-        _la = this._input.LA(1);
-        if(_la===ivprogParser.T__5) {
-            this.state = 63;
-            this.match(ivprogParser.T__5);
-            this.state = 64;
-            localctx.inicializacao = this.expressao();
-        }
-
-
-            const constante = (localctx.tokenConst != null);
-            const tipoDado = (localctx.informacaoTipoDado != null)? localctx.informacaoTipoDado.tipoDado : null;
-            const nome = (localctx._ID != null)? (localctx._ID===null ? null : localctx._ID.text) : null;
-            
-            if ((localctx.tk1 == null) && (localctx.tk2 == null))
-              localctx.rDeclaracao =  new NoDeclaracaoVariavel(nome, tipoDado, constante)
-            else
-            
-            if ((localctx.tk1 != null) && (localctx.tk2 == null))
-              localctx.rDeclaracao =  new NoDeclaracaoVetor(nome, tipoDado, (localctx.ind1===null ? null : this._input.getText(new antlr4.Interval(localctx.ind1.start,localctx.ind1.stop))), constante)
-            
-            else
-            
-            if ((localctx.tk1 != null) && (localctx.tk2 != null))
-              localctx.rDeclaracao =  new NoDeclaracaoMatriz(nome, tipoDado, (localctx.ind1===null ? null : this._input.getText(new antlr4.Interval(localctx.ind1.start,localctx.ind1.stop))), (localctx.ind2===null ? null : this._input.getText(new antlr4.Interval(localctx.ind2.start,localctx.ind2.stop))), constante)
-          
-            localctx.rDeclaracao.setInicializacao(inicializacao);
-            localctx.rDeclaracao.setTrechoCodigoFonteNome(criarTrechoCodigoFonte(localctx._ID));
-            localctx.rDeclaracao.setTrechoCodigoFonteTipoDado((localctx.informacaoTipoDado != null)? localctx.informacaoTipoDado.getTrechoCodigoFonte(): null);
-          
-    } catch (re) {
-    	if(re instanceof antlr4.error.RecognitionException) {
-	        localctx.exception = re;
-	        this._errHandler.reportError(this, re);
-	        this._errHandler.recover(this, re);
-	    } else {
-	    	throw re;
-	    }
-    } finally {
-        this.exitRule();
-    }
-    return localctx;
-};
-
-function DeclaracaoTipoDadoContext(parser, parent, invokingState) {
-	if(parent===undefined) {
-	    parent = null;
-	}
-	if(invokingState===undefined || invokingState===null) {
-		invokingState = -1;
-	}
-	antlr4.ParserRuleContext.call(this, parent, invokingState);
-    this.parser = parser;
-    this.ruleIndex = ivprogParser.RULE_declaracaoTipoDado;
-    this.informacaoTipoDado = null
-    this.tokenTipoDado = null; // Token
-    return this;
-}
-
-DeclaracaoTipoDadoContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
-DeclaracaoTipoDadoContext.prototype.constructor = DeclaracaoTipoDadoContext;
-
-DeclaracaoTipoDadoContext.prototype.PR_INTEIRO = function() {
-    return this.getToken(ivprogParser.PR_INTEIRO, 0);
-};
-
-DeclaracaoTipoDadoContext.prototype.PR_REAL = function() {
-    return this.getToken(ivprogParser.PR_REAL, 0);
-};
-
-DeclaracaoTipoDadoContext.prototype.PR_CARACTER = function() {
-    return this.getToken(ivprogParser.PR_CARACTER, 0);
-};
-
-DeclaracaoTipoDadoContext.prototype.PR_CADEIA = function() {
-    return this.getToken(ivprogParser.PR_CADEIA, 0);
-};
-
-DeclaracaoTipoDadoContext.prototype.PR_LOGICO = function() {
-    return this.getToken(ivprogParser.PR_LOGICO, 0);
-};
-
-DeclaracaoTipoDadoContext.prototype.enterRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.enterDeclaracaoTipoDado(this);
-	}
-};
-
-DeclaracaoTipoDadoContext.prototype.exitRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.exitDeclaracaoTipoDado(this);
-	}
-};
-
-
-
-
-ivprogParser.DeclaracaoTipoDadoContext = DeclaracaoTipoDadoContext;
-
-ivprogParser.prototype.declaracaoTipoDado = function() {
-
-    var localctx = new DeclaracaoTipoDadoContext(this, this._ctx, this.state);
-    this.enterRule(localctx, 10, ivprogParser.RULE_declaracaoTipoDado);
-    try {
-        this.enterOuterAlt(localctx, 1);
-        this.state = 74;
-        this._errHandler.sync(this);
-        switch(this._input.LA(1)) {
-        case ivprogParser.PR_INTEIRO:
-            this.state = 69;
-            localctx.tokenTipoDado = this.match(ivprogParser.PR_INTEIRO);
-            break;
-        case ivprogParser.PR_REAL:
-            this.state = 70;
-            localctx.tokenTipoDado = this.match(ivprogParser.PR_REAL);
-            break;
-        case ivprogParser.PR_CARACTER:
-            this.state = 71;
-            localctx.tokenTipoDado = this.match(ivprogParser.PR_CARACTER);
-            break;
-        case ivprogParser.PR_CADEIA:
-            this.state = 72;
-            localctx.tokenTipoDado = this.match(ivprogParser.PR_CADEIA);
-            break;
-        case ivprogParser.PR_LOGICO:
-            this.state = 73;
-            localctx.tokenTipoDado = this.match(ivprogParser.PR_LOGICO);
-            break;
-        default:
-            throw new antlr4.error.NoViableAltException(this);
-        }
-
-            localctx.informacaoTipoDado =  new InformacaoTipoDado()
-            localctx.informacaoTipoDado.setTipoDado(localctx.tokenTipoDado);
-            localctx.informacaoTipoDado.setTrechoCodigoFonte(criarTrechoCodigoFonte(localctx.tokenTipoDado));
-          
-    } catch (re) {
-    	if(re instanceof antlr4.error.RecognitionException) {
-	        localctx.exception = re;
-	        this._errHandler.reportError(this, re);
-	        this._errHandler.recover(this, re);
-	    } else {
-	    	throw re;
-	    }
-    } finally {
-        this.exitRule();
-    }
-    return localctx;
-};
-
-function ExpressaoContext(parser, parent, invokingState) {
-	if(parent===undefined) {
-	    parent = null;
-	}
-	if(invokingState===undefined || invokingState===null) {
-		invokingState = -1;
-	}
-	antlr4.ParserRuleContext.call(this, parent, invokingState);
-    this.parser = parser;
-    this.ruleIndex = ivprogParser.RULE_expressao;
-    return this;
-}
-
-ExpressaoContext.prototype = Object.create(antlr4.ParserRuleContext.prototype);
-ExpressaoContext.prototype.constructor = ExpressaoContext;
-
-ExpressaoContext.prototype.INTEIRO = function() {
-    return this.getToken(ivprogParser.INTEIRO, 0);
-};
-
-ExpressaoContext.prototype.CADEIA = function() {
-    return this.getToken(ivprogParser.CADEIA, 0);
-};
-
-ExpressaoContext.prototype.enterRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.enterExpressao(this);
-	}
-};
-
-ExpressaoContext.prototype.exitRule = function(listener) {
-    if(listener instanceof ivprogListener ) {
-        listener.exitExpressao(this);
-	}
-};
-
-
-
-
-ivprogParser.ExpressaoContext = ExpressaoContext;
-
-ivprogParser.prototype.expressao = function() {
-
-    var localctx = new ExpressaoContext(this, this._ctx, this.state);
-    this.enterRule(localctx, 12, ivprogParser.RULE_expressao);
-    var _la = 0; // Token type
-    try {
-        this.enterOuterAlt(localctx, 1);
-        this.state = 78;
-        _la = this._input.LA(1);
-        if(!(_la===ivprogParser.INTEIRO || _la===ivprogParser.CADEIA)) {
-        this._errHandler.recoverInline(this);
-        }
-        else {
-        	this._errHandler.reportMatch(this);
-            this.consume();
-        }
-    } catch (re) {
-    	if(re instanceof antlr4.error.RecognitionException) {
-	        localctx.exception = re;
-	        this._errHandler.reportError(this, re);
-	        this._errHandler.recover(this, re);
-	    } else {
-	    	throw re;
-	    }
-    } finally {
-        this.exitRule();
-    }
-    return localctx;
-};
-
-
-exports.ivprogParser = ivprogParser;

+ 0 - 40
grammar/ivprogVisitor.js

@@ -1,40 +0,0 @@
-// Generated from ../ivprog/grammar/ivprog.g4 by ANTLR 4.7.1
-// jshint ignore: start
-var antlr4 = require('antlr4/index');
-
-// This class defines a complete generic visitor for a parse tree produced by ivprogParser.
-
-function ivprogVisitor() {
-	antlr4.tree.ParseTreeVisitor.call(this);
-	return this;
-}
-
-ivprogVisitor.prototype = Object.create(antlr4.tree.ParseTreeVisitor.prototype);
-ivprogVisitor.prototype.constructor = ivprogVisitor;
-
-// Visit a parse tree produced by ivprogParser#parse.
-ivprogVisitor.prototype.visitParse = function(ctx) {
-  return this.visitChildren(ctx);
-};
-
-
-// Visit a parse tree produced by ivprogParser#programa.
-ivprogVisitor.prototype.visitPrograma = function(ctx) {
-  return this.visitChildren(ctx);
-};
-
-
-// Visit a parse tree produced by ivprogParser#declaracoesGlobais.
-ivprogVisitor.prototype.visitDeclaracoesGlobais = function(ctx) {
-  return this.visitChildren(ctx);
-};
-
-
-// Visit a parse tree produced by ivprogParser#listaDeclaracoes.
-ivprogVisitor.prototype.visitListaDeclaracoes = function(ctx) {
-  return this.visitChildren(ctx);
-};
-
-
-
-exports.ivprogVisitor = ivprogVisitor;

+ 76 - 0
grammar/pt-br/ivprog.g4

@@ -0,0 +1,76 @@
+lexer grammar ivprog;
+
+PR_PROGRAMA     : 'programa'    ;
+PR_REAL       : 'real'    ;
+PR_VAZIO        : 'vazio'   ;
+PR_LOGICO       : 'logico'    ;
+PR_CADEIA       : 'cadeia'    ;
+PR_INTEIRO        : 'inteiro'   ;
+PR_CARACTER     : 'caracter'    ;    
+PR_ESCOLHA        : 'escolha'   ;
+PR_CASO       : 'caso'    ;
+PR_CONTRARIO      : 'contrario' ;
+PR_CONST        : 'const'   ;
+PR_FUNCAO       : 'funcao'    ;
+PR_RETORNE        : 'retorne'   ;  
+PR_PARA       : 'para'    ;
+PR_PARE       : 'pare'    ;
+PR_FACA       : 'faca'    ;
+PR_ENQUANTO     : 'enquanto'    ;
+PR_SE       : 'se'    ;
+PR_SENAO        : 'senao'   ;
+
+
+GAMBIARRA   : '.' |'á'| 'à'| 'ã'|'â'|'é'|'ê'|'í'|'ó'|'ô'|'õ'|'ú'|'ü'|'ç'|'Ä'|'À'|'Ã'|'Â'|'É'|'Ê'|'Ë'|'Ó'|'Ô'|'Õ'|'Ú'|'Ü'|'Ç'|'#'|'$'|'"'|'§'|'?'|'¹'|'²'|'³'|'£'|'¢'|'¬'|'ª'|'º'|'~'|'\''|'`'|'\\'|'@';
+ 
+fragment PR_FALSO     : 'falso'   ;
+fragment PR_VERDADEIRO    : 'verdadeiro'    ;
+
+ABRE_PAR: '(';
+FECHA_PAR: ')';
+ABRE_COL: '[';
+FECHA_COL: ']';
+ABRE_CHA: '{';
+FECHA_CHA: '}';
+VIRGULA: ',';
+PONTO_VIRGULA: ';';
+ATRIBUICAO: '=';
+OPERADOR_ARITMETICO: ('+'|'-'|'*'|'/'|'%');
+OPERADOR_E: 'E';
+OPERADOR_OU: 'OU';
+OPERADOR_RELACIONAL: ('>='|'=='|'<='|'>'|'<');
+DPONTOS: ':';
+
+OPERADOR_NAO      : 'nao'   ;
+
+LOGICO        :   PR_VERDADEIRO | PR_FALSO  ;
+
+ID        : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*  ;
+
+// ID_BIBLIOTECA     : ID '.' ID;
+
+INTEIRO         : '0'..'9'+ | ('0x'|'0X')(DIGIT_HEX)+ | ('0b'|'0B')('0'|'1')+;
+
+REAL          :   ('0'..'9')+ '.' ('0'..'9')+ ;
+    
+CADEIA        : '"' ( SEQ_ESC | ~('\\'|'"') )* '"'  ;
+
+CARACTER        :   '\'' ( SEQ_ESC | ~('\''|'\\') ) '\''  ;
+
+ESPACO        : ( ' ' | '\t' | '\r' | '\n') -> channel(HIDDEN)  ;
+
+
+fragment DIGIT_HEX    :   ('0'..'9'|'a'..'f'|'A'..'F')  ;
+
+fragment SEQ_ESC      :  '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')  |   ESC_UNICODE  |   ESC_OCTAL   ;
+
+fragment ESC_OCTAL    : '\\' ('0'..'3') ('0'..'7') ('0'..'7')  |   '\\' ('0'..'7') ('0'..'7')    |   '\\' ('0'..'7')    ;
+
+fragment ESC_UNICODE    : '\\' 'u' DIGIT_HEX DIGIT_HEX DIGIT_HEX DIGIT_HEX  ;
+
+COMENTARIO      :   
+
+  ('//' ~('\n'|'\r')* '\r'? '\n' |  
+  
+  '/*' .*? '*/') -> channel(HIDDEN)
+ ;

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 152 - 0
grammar/pt-br/ivprog.interp


+ 388 - 0
grammar/pt-br/ivprog.js

@@ -0,0 +1,388 @@
+// Generated from grammar/pt-br/ivprog.g4 by ANTLR 4.7.1
+// jshint ignore: start
+var antlr4 = require('antlr4/index');
+
+
+var serializedATN = ["\u0003\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964",
+    "\u0002-\u01a2\b\u0001\u0004\u0002\t\u0002\u0004\u0003\t\u0003\u0004",
+    "\u0004\t\u0004\u0004\u0005\t\u0005\u0004\u0006\t\u0006\u0004\u0007\t",
+    "\u0007\u0004\b\t\b\u0004\t\t\t\u0004\n\t\n\u0004\u000b\t\u000b\u0004",
+    "\f\t\f\u0004\r\t\r\u0004\u000e\t\u000e\u0004\u000f\t\u000f\u0004\u0010",
+    "\t\u0010\u0004\u0011\t\u0011\u0004\u0012\t\u0012\u0004\u0013\t\u0013",
+    "\u0004\u0014\t\u0014\u0004\u0015\t\u0015\u0004\u0016\t\u0016\u0004\u0017",
+    "\t\u0017\u0004\u0018\t\u0018\u0004\u0019\t\u0019\u0004\u001a\t\u001a",
+    "\u0004\u001b\t\u001b\u0004\u001c\t\u001c\u0004\u001d\t\u001d\u0004\u001e",
+    "\t\u001e\u0004\u001f\t\u001f\u0004 \t \u0004!\t!\u0004\"\t\"\u0004#",
+    "\t#\u0004$\t$\u0004%\t%\u0004&\t&\u0004\'\t\'\u0004(\t(\u0004)\t)\u0004",
+    "*\t*\u0004+\t+\u0004,\t,\u0004-\t-\u0004.\t.\u0004/\t/\u00040\t0\u0004",
+    "1\t1\u00042\t2\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003",
+    "\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0003\u0003",
+    "\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0004\u0003\u0004\u0003",
+    "\u0004\u0003\u0004\u0003\u0004\u0003\u0004\u0003\u0005\u0003\u0005\u0003",
+    "\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0006\u0003",
+    "\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003",
+    "\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003",
+    "\u0007\u0003\u0007\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003",
+    "\b\u0003\b\u0003\b\u0003\t\u0003\t\u0003\t\u0003\t\u0003\t\u0003\t\u0003",
+    "\t\u0003\t\u0003\n\u0003\n\u0003\n\u0003\n\u0003\n\u0003\u000b\u0003",
+    "\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003",
+    "\u000b\u0003\u000b\u0003\u000b\u0003\f\u0003\f\u0003\f\u0003\f\u0003",
+    "\f\u0003\f\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003",
+    "\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003",
+    "\u000e\u0003\u000e\u0003\u000f\u0003\u000f\u0003\u000f\u0003\u000f\u0003",
+    "\u000f\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003",
+    "\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0012\u0003",
+    "\u0012\u0003\u0012\u0003\u0012\u0003\u0012\u0003\u0012\u0003\u0012\u0003",
+    "\u0012\u0003\u0012\u0003\u0013\u0003\u0013\u0003\u0013\u0003\u0014\u0003",
+    "\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003\u0015\u0003",
+    "\u0015\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003",
+    "\u0016\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003",
+    "\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003",
+    "\u0018\u0003\u0018\u0003\u0019\u0003\u0019\u0003\u001a\u0003\u001a\u0003",
+    "\u001b\u0003\u001b\u0003\u001c\u0003\u001c\u0003\u001d\u0003\u001d\u0003",
+    "\u001e\u0003\u001e\u0003\u001f\u0003\u001f\u0003 \u0003 \u0003!\u0003",
+    "!\u0003\"\u0003\"\u0003#\u0003#\u0003#\u0003$\u0003$\u0003$\u0003$\u0003",
+    "$\u0003$\u0003$\u0005$\u0119\n$\u0003%\u0003%\u0003&\u0003&\u0003&\u0003",
+    "&\u0003\'\u0003\'\u0005\'\u0123\n\'\u0003(\u0003(\u0007(\u0127\n(\f",
+    "(\u000e(\u012a\u000b(\u0003)\u0006)\u012d\n)\r)\u000e)\u012e\u0003)",
+    "\u0003)\u0003)\u0003)\u0005)\u0135\n)\u0003)\u0006)\u0138\n)\r)\u000e",
+    ")\u0139\u0003)\u0003)\u0003)\u0003)\u0005)\u0140\n)\u0003)\u0006)\u0143",
+    "\n)\r)\u000e)\u0144\u0005)\u0147\n)\u0003*\u0006*\u014a\n*\r*\u000e",
+    "*\u014b\u0003*\u0003*\u0006*\u0150\n*\r*\u000e*\u0151\u0003+\u0003+",
+    "\u0003+\u0007+\u0157\n+\f+\u000e+\u015a\u000b+\u0003+\u0003+\u0003,",
+    "\u0003,\u0003,\u0005,\u0161\n,\u0003,\u0003,\u0003-\u0003-\u0003-\u0003",
+    "-\u0003.\u0003.\u0003/\u0003/\u0003/\u0003/\u0005/\u016f\n/\u0003/\u0003",
+    "/\u0005/\u0173\n/\u00030\u00030\u00030\u00030\u00030\u00030\u00030\u0003",
+    "0\u00030\u00050\u017e\n0\u00031\u00031\u00031\u00031\u00031\u00031\u0003",
+    "1\u00032\u00032\u00032\u00032\u00072\u018b\n2\f2\u000e2\u018e\u000b",
+    "2\u00032\u00052\u0191\n2\u00032\u00032\u00032\u00032\u00032\u00072\u0198",
+    "\n2\f2\u000e2\u019b\u000b2\u00032\u00032\u00052\u019f\n2\u00032\u0003",
+    "2\u0003\u0199\u00023\u0003\u0003\u0005\u0004\u0007\u0005\t\u0006\u000b",
+    "\u0007\r\b\u000f\t\u0011\n\u0013\u000b\u0015\f\u0017\r\u0019\u000e\u001b",
+    "\u000f\u001d\u0010\u001f\u0011!\u0012#\u0013%\u0014\'\u0015)\u0016+",
+    "\u0002-\u0002/\u00171\u00183\u00195\u001a7\u001b9\u001c;\u001d=\u001e",
+    "?\u001fA C!E\"G#I$K%M&O\'Q(S)U*W+Y,[\u0002]\u0002_\u0002a\u0002c-\u0003",
+    "\u0002\r\u001d\u0002$&))00AB^^bb\u0080\u0080\u00a4\u00a5\u00a9\u00a9",
+    "\u00ac\u00ac\u00ae\u00ae\u00b4\u00b5\u00bb\u00bc\u00c2\u00c2\u00c4\u00c6",
+    "\u00c9\u00c9\u00cb\u00cd\u00d5\u00d7\u00dc\u00dc\u00de\u00de\u00e2\u00e5",
+    "\u00e9\u00e9\u00eb\u00ec\u00ef\u00ef\u00f5\u00f7\u00fc\u00fc\u00fe\u00fe",
+    "\u0006\u0002\'\',-//11\u0004\u0002>>@@\u0005\u0002C\\aac|\u0006\u0002",
+    "2;C\\aac|\u0004\u0002$$^^\u0004\u0002))^^\u0005\u0002\u000b\f\u000f",
+    "\u000f\"\"\u0005\u00022;CHch\u0007\u0002ddhhppttvv\u0004\u0002\f\f\u000f",
+    "\u000f\u0002\u01b6\u0002\u0003\u0003\u0002\u0002\u0002\u0002\u0005\u0003",
+    "\u0002\u0002\u0002\u0002\u0007\u0003\u0002\u0002\u0002\u0002\t\u0003",
+    "\u0002\u0002\u0002\u0002\u000b\u0003\u0002\u0002\u0002\u0002\r\u0003",
+    "\u0002\u0002\u0002\u0002\u000f\u0003\u0002\u0002\u0002\u0002\u0011\u0003",
+    "\u0002\u0002\u0002\u0002\u0013\u0003\u0002\u0002\u0002\u0002\u0015\u0003",
+    "\u0002\u0002\u0002\u0002\u0017\u0003\u0002\u0002\u0002\u0002\u0019\u0003",
+    "\u0002\u0002\u0002\u0002\u001b\u0003\u0002\u0002\u0002\u0002\u001d\u0003",
+    "\u0002\u0002\u0002\u0002\u001f\u0003\u0002\u0002\u0002\u0002!\u0003",
+    "\u0002\u0002\u0002\u0002#\u0003\u0002\u0002\u0002\u0002%\u0003\u0002",
+    "\u0002\u0002\u0002\'\u0003\u0002\u0002\u0002\u0002)\u0003\u0002\u0002",
+    "\u0002\u0002/\u0003\u0002\u0002\u0002\u00021\u0003\u0002\u0002\u0002",
+    "\u00023\u0003\u0002\u0002\u0002\u00025\u0003\u0002\u0002\u0002\u0002",
+    "7\u0003\u0002\u0002\u0002\u00029\u0003\u0002\u0002\u0002\u0002;\u0003",
+    "\u0002\u0002\u0002\u0002=\u0003\u0002\u0002\u0002\u0002?\u0003\u0002",
+    "\u0002\u0002\u0002A\u0003\u0002\u0002\u0002\u0002C\u0003\u0002\u0002",
+    "\u0002\u0002E\u0003\u0002\u0002\u0002\u0002G\u0003\u0002\u0002\u0002",
+    "\u0002I\u0003\u0002\u0002\u0002\u0002K\u0003\u0002\u0002\u0002\u0002",
+    "M\u0003\u0002\u0002\u0002\u0002O\u0003\u0002\u0002\u0002\u0002Q\u0003",
+    "\u0002\u0002\u0002\u0002S\u0003\u0002\u0002\u0002\u0002U\u0003\u0002",
+    "\u0002\u0002\u0002W\u0003\u0002\u0002\u0002\u0002Y\u0003\u0002\u0002",
+    "\u0002\u0002c\u0003\u0002\u0002\u0002\u0003e\u0003\u0002\u0002\u0002",
+    "\u0005n\u0003\u0002\u0002\u0002\u0007s\u0003\u0002\u0002\u0002\ty\u0003",
+    "\u0002\u0002\u0002\u000b\u0080\u0003\u0002\u0002\u0002\r\u0087\u0003",
+    "\u0002\u0002\u0002\u000f\u008f\u0003\u0002\u0002\u0002\u0011\u0098\u0003",
+    "\u0002\u0002\u0002\u0013\u00a0\u0003\u0002\u0002\u0002\u0015\u00a5\u0003",
+    "\u0002\u0002\u0002\u0017\u00af\u0003\u0002\u0002\u0002\u0019\u00b5\u0003",
+    "\u0002\u0002\u0002\u001b\u00bc\u0003\u0002\u0002\u0002\u001d\u00c4\u0003",
+    "\u0002\u0002\u0002\u001f\u00c9\u0003\u0002\u0002\u0002!\u00ce\u0003",
+    "\u0002\u0002\u0002#\u00d3\u0003\u0002\u0002\u0002%\u00dc\u0003\u0002",
+    "\u0002\u0002\'\u00df\u0003\u0002\u0002\u0002)\u00e5\u0003\u0002\u0002",
+    "\u0002+\u00e7\u0003\u0002\u0002\u0002-\u00ed\u0003\u0002\u0002\u0002",
+    "/\u00f8\u0003\u0002\u0002\u00021\u00fa\u0003\u0002\u0002\u00023\u00fc",
+    "\u0003\u0002\u0002\u00025\u00fe\u0003\u0002\u0002\u00027\u0100\u0003",
+    "\u0002\u0002\u00029\u0102\u0003\u0002\u0002\u0002;\u0104\u0003\u0002",
+    "\u0002\u0002=\u0106\u0003\u0002\u0002\u0002?\u0108\u0003\u0002\u0002",
+    "\u0002A\u010a\u0003\u0002\u0002\u0002C\u010c\u0003\u0002\u0002\u0002",
+    "E\u010e\u0003\u0002\u0002\u0002G\u0118\u0003\u0002\u0002\u0002I\u011a",
+    "\u0003\u0002\u0002\u0002K\u011c\u0003\u0002\u0002\u0002M\u0122\u0003",
+    "\u0002\u0002\u0002O\u0124\u0003\u0002\u0002\u0002Q\u0146\u0003\u0002",
+    "\u0002\u0002S\u0149\u0003\u0002\u0002\u0002U\u0153\u0003\u0002\u0002",
+    "\u0002W\u015d\u0003\u0002\u0002\u0002Y\u0164\u0003\u0002\u0002\u0002",
+    "[\u0168\u0003\u0002\u0002\u0002]\u0172\u0003\u0002\u0002\u0002_\u017d",
+    "\u0003\u0002\u0002\u0002a\u017f\u0003\u0002\u0002\u0002c\u019e\u0003",
+    "\u0002\u0002\u0002ef\u0007r\u0002\u0002fg\u0007t\u0002\u0002gh\u0007",
+    "q\u0002\u0002hi\u0007i\u0002\u0002ij\u0007t\u0002\u0002jk\u0007c\u0002",
+    "\u0002kl\u0007o\u0002\u0002lm\u0007c\u0002\u0002m\u0004\u0003\u0002",
+    "\u0002\u0002no\u0007t\u0002\u0002op\u0007g\u0002\u0002pq\u0007c\u0002",
+    "\u0002qr\u0007n\u0002\u0002r\u0006\u0003\u0002\u0002\u0002st\u0007x",
+    "\u0002\u0002tu\u0007c\u0002\u0002uv\u0007|\u0002\u0002vw\u0007k\u0002",
+    "\u0002wx\u0007q\u0002\u0002x\b\u0003\u0002\u0002\u0002yz\u0007n\u0002",
+    "\u0002z{\u0007q\u0002\u0002{|\u0007i\u0002\u0002|}\u0007k\u0002\u0002",
+    "}~\u0007e\u0002\u0002~\u007f\u0007q\u0002\u0002\u007f\n\u0003\u0002",
+    "\u0002\u0002\u0080\u0081\u0007e\u0002\u0002\u0081\u0082\u0007c\u0002",
+    "\u0002\u0082\u0083\u0007f\u0002\u0002\u0083\u0084\u0007g\u0002\u0002",
+    "\u0084\u0085\u0007k\u0002\u0002\u0085\u0086\u0007c\u0002\u0002\u0086",
+    "\f\u0003\u0002\u0002\u0002\u0087\u0088\u0007k\u0002\u0002\u0088\u0089",
+    "\u0007p\u0002\u0002\u0089\u008a\u0007v\u0002\u0002\u008a\u008b\u0007",
+    "g\u0002\u0002\u008b\u008c\u0007k\u0002\u0002\u008c\u008d\u0007t\u0002",
+    "\u0002\u008d\u008e\u0007q\u0002\u0002\u008e\u000e\u0003\u0002\u0002",
+    "\u0002\u008f\u0090\u0007e\u0002\u0002\u0090\u0091\u0007c\u0002\u0002",
+    "\u0091\u0092\u0007t\u0002\u0002\u0092\u0093\u0007c\u0002\u0002\u0093",
+    "\u0094\u0007e\u0002\u0002\u0094\u0095\u0007v\u0002\u0002\u0095\u0096",
+    "\u0007g\u0002\u0002\u0096\u0097\u0007t\u0002\u0002\u0097\u0010\u0003",
+    "\u0002\u0002\u0002\u0098\u0099\u0007g\u0002\u0002\u0099\u009a\u0007",
+    "u\u0002\u0002\u009a\u009b\u0007e\u0002\u0002\u009b\u009c\u0007q\u0002",
+    "\u0002\u009c\u009d\u0007n\u0002\u0002\u009d\u009e\u0007j\u0002\u0002",
+    "\u009e\u009f\u0007c\u0002\u0002\u009f\u0012\u0003\u0002\u0002\u0002",
+    "\u00a0\u00a1\u0007e\u0002\u0002\u00a1\u00a2\u0007c\u0002\u0002\u00a2",
+    "\u00a3\u0007u\u0002\u0002\u00a3\u00a4\u0007q\u0002\u0002\u00a4\u0014",
+    "\u0003\u0002\u0002\u0002\u00a5\u00a6\u0007e\u0002\u0002\u00a6\u00a7",
+    "\u0007q\u0002\u0002\u00a7\u00a8\u0007p\u0002\u0002\u00a8\u00a9\u0007",
+    "v\u0002\u0002\u00a9\u00aa\u0007t\u0002\u0002\u00aa\u00ab\u0007c\u0002",
+    "\u0002\u00ab\u00ac\u0007t\u0002\u0002\u00ac\u00ad\u0007k\u0002\u0002",
+    "\u00ad\u00ae\u0007q\u0002\u0002\u00ae\u0016\u0003\u0002\u0002\u0002",
+    "\u00af\u00b0\u0007e\u0002\u0002\u00b0\u00b1\u0007q\u0002\u0002\u00b1",
+    "\u00b2\u0007p\u0002\u0002\u00b2\u00b3\u0007u\u0002\u0002\u00b3\u00b4",
+    "\u0007v\u0002\u0002\u00b4\u0018\u0003\u0002\u0002\u0002\u00b5\u00b6",
+    "\u0007h\u0002\u0002\u00b6\u00b7\u0007w\u0002\u0002\u00b7\u00b8\u0007",
+    "p\u0002\u0002\u00b8\u00b9\u0007e\u0002\u0002\u00b9\u00ba\u0007c\u0002",
+    "\u0002\u00ba\u00bb\u0007q\u0002\u0002\u00bb\u001a\u0003\u0002\u0002",
+    "\u0002\u00bc\u00bd\u0007t\u0002\u0002\u00bd\u00be\u0007g\u0002\u0002",
+    "\u00be\u00bf\u0007v\u0002\u0002\u00bf\u00c0\u0007q\u0002\u0002\u00c0",
+    "\u00c1\u0007t\u0002\u0002\u00c1\u00c2\u0007p\u0002\u0002\u00c2\u00c3",
+    "\u0007g\u0002\u0002\u00c3\u001c\u0003\u0002\u0002\u0002\u00c4\u00c5",
+    "\u0007r\u0002\u0002\u00c5\u00c6\u0007c\u0002\u0002\u00c6\u00c7\u0007",
+    "t\u0002\u0002\u00c7\u00c8\u0007c\u0002\u0002\u00c8\u001e\u0003\u0002",
+    "\u0002\u0002\u00c9\u00ca\u0007r\u0002\u0002\u00ca\u00cb\u0007c\u0002",
+    "\u0002\u00cb\u00cc\u0007t\u0002\u0002\u00cc\u00cd\u0007g\u0002\u0002",
+    "\u00cd \u0003\u0002\u0002\u0002\u00ce\u00cf\u0007h\u0002\u0002\u00cf",
+    "\u00d0\u0007c\u0002\u0002\u00d0\u00d1\u0007e\u0002\u0002\u00d1\u00d2",
+    "\u0007c\u0002\u0002\u00d2\"\u0003\u0002\u0002\u0002\u00d3\u00d4\u0007",
+    "g\u0002\u0002\u00d4\u00d5\u0007p\u0002\u0002\u00d5\u00d6\u0007s\u0002",
+    "\u0002\u00d6\u00d7\u0007w\u0002\u0002\u00d7\u00d8\u0007c\u0002\u0002",
+    "\u00d8\u00d9\u0007p\u0002\u0002\u00d9\u00da\u0007v\u0002\u0002\u00da",
+    "\u00db\u0007q\u0002\u0002\u00db$\u0003\u0002\u0002\u0002\u00dc\u00dd",
+    "\u0007u\u0002\u0002\u00dd\u00de\u0007g\u0002\u0002\u00de&\u0003\u0002",
+    "\u0002\u0002\u00df\u00e0\u0007u\u0002\u0002\u00e0\u00e1\u0007g\u0002",
+    "\u0002\u00e1\u00e2\u0007p\u0002\u0002\u00e2\u00e3\u0007c\u0002\u0002",
+    "\u00e3\u00e4\u0007q\u0002\u0002\u00e4(\u0003\u0002\u0002\u0002\u00e5",
+    "\u00e6\t\u0002\u0002\u0002\u00e6*\u0003\u0002\u0002\u0002\u00e7\u00e8",
+    "\u0007h\u0002\u0002\u00e8\u00e9\u0007c\u0002\u0002\u00e9\u00ea\u0007",
+    "n\u0002\u0002\u00ea\u00eb\u0007u\u0002\u0002\u00eb\u00ec\u0007q\u0002",
+    "\u0002\u00ec,\u0003\u0002\u0002\u0002\u00ed\u00ee\u0007x\u0002\u0002",
+    "\u00ee\u00ef\u0007g\u0002\u0002\u00ef\u00f0\u0007t\u0002\u0002\u00f0",
+    "\u00f1\u0007f\u0002\u0002\u00f1\u00f2\u0007c\u0002\u0002\u00f2\u00f3",
+    "\u0007f\u0002\u0002\u00f3\u00f4\u0007g\u0002\u0002\u00f4\u00f5\u0007",
+    "k\u0002\u0002\u00f5\u00f6\u0007t\u0002\u0002\u00f6\u00f7\u0007q\u0002",
+    "\u0002\u00f7.\u0003\u0002\u0002\u0002\u00f8\u00f9\u0007*\u0002\u0002",
+    "\u00f90\u0003\u0002\u0002\u0002\u00fa\u00fb\u0007+\u0002\u0002\u00fb",
+    "2\u0003\u0002\u0002\u0002\u00fc\u00fd\u0007]\u0002\u0002\u00fd4\u0003",
+    "\u0002\u0002\u0002\u00fe\u00ff\u0007_\u0002\u0002\u00ff6\u0003\u0002",
+    "\u0002\u0002\u0100\u0101\u0007}\u0002\u0002\u01018\u0003\u0002\u0002",
+    "\u0002\u0102\u0103\u0007\u007f\u0002\u0002\u0103:\u0003\u0002\u0002",
+    "\u0002\u0104\u0105\u0007.\u0002\u0002\u0105<\u0003\u0002\u0002\u0002",
+    "\u0106\u0107\u0007=\u0002\u0002\u0107>\u0003\u0002\u0002\u0002\u0108",
+    "\u0109\u0007?\u0002\u0002\u0109@\u0003\u0002\u0002\u0002\u010a\u010b",
+    "\t\u0003\u0002\u0002\u010bB\u0003\u0002\u0002\u0002\u010c\u010d\u0007",
+    "G\u0002\u0002\u010dD\u0003\u0002\u0002\u0002\u010e\u010f\u0007Q\u0002",
+    "\u0002\u010f\u0110\u0007W\u0002\u0002\u0110F\u0003\u0002\u0002\u0002",
+    "\u0111\u0112\u0007@\u0002\u0002\u0112\u0119\u0007?\u0002\u0002\u0113",
+    "\u0114\u0007?\u0002\u0002\u0114\u0119\u0007?\u0002\u0002\u0115\u0116",
+    "\u0007>\u0002\u0002\u0116\u0119\u0007?\u0002\u0002\u0117\u0119\t\u0004",
+    "\u0002\u0002\u0118\u0111\u0003\u0002\u0002\u0002\u0118\u0113\u0003\u0002",
+    "\u0002\u0002\u0118\u0115\u0003\u0002\u0002\u0002\u0118\u0117\u0003\u0002",
+    "\u0002\u0002\u0119H\u0003\u0002\u0002\u0002\u011a\u011b\u0007<\u0002",
+    "\u0002\u011bJ\u0003\u0002\u0002\u0002\u011c\u011d\u0007p\u0002\u0002",
+    "\u011d\u011e\u0007c\u0002\u0002\u011e\u011f\u0007q\u0002\u0002\u011f",
+    "L\u0003\u0002\u0002\u0002\u0120\u0123\u0005-\u0017\u0002\u0121\u0123",
+    "\u0005+\u0016\u0002\u0122\u0120\u0003\u0002\u0002\u0002\u0122\u0121",
+    "\u0003\u0002\u0002\u0002\u0123N\u0003\u0002\u0002\u0002\u0124\u0128",
+    "\t\u0005\u0002\u0002\u0125\u0127\t\u0006\u0002\u0002\u0126\u0125\u0003",
+    "\u0002\u0002\u0002\u0127\u012a\u0003\u0002\u0002\u0002\u0128\u0126\u0003",
+    "\u0002\u0002\u0002\u0128\u0129\u0003\u0002\u0002\u0002\u0129P\u0003",
+    "\u0002\u0002\u0002\u012a\u0128\u0003\u0002\u0002\u0002\u012b\u012d\u0004",
+    "2;\u0002\u012c\u012b\u0003\u0002\u0002\u0002\u012d\u012e\u0003\u0002",
+    "\u0002\u0002\u012e\u012c\u0003\u0002\u0002\u0002\u012e\u012f\u0003\u0002",
+    "\u0002\u0002\u012f\u0147\u0003\u0002\u0002\u0002\u0130\u0131\u00072",
+    "\u0002\u0002\u0131\u0135\u0007z\u0002\u0002\u0132\u0133\u00072\u0002",
+    "\u0002\u0133\u0135\u0007Z\u0002\u0002\u0134\u0130\u0003\u0002\u0002",
+    "\u0002\u0134\u0132\u0003\u0002\u0002\u0002\u0135\u0137\u0003\u0002\u0002",
+    "\u0002\u0136\u0138\u0005[.\u0002\u0137\u0136\u0003\u0002\u0002\u0002",
+    "\u0138\u0139\u0003\u0002\u0002\u0002\u0139\u0137\u0003\u0002\u0002\u0002",
+    "\u0139\u013a\u0003\u0002\u0002\u0002\u013a\u0147\u0003\u0002\u0002\u0002",
+    "\u013b\u013c\u00072\u0002\u0002\u013c\u0140\u0007d\u0002\u0002\u013d",
+    "\u013e\u00072\u0002\u0002\u013e\u0140\u0007D\u0002\u0002\u013f\u013b",
+    "\u0003\u0002\u0002\u0002\u013f\u013d\u0003\u0002\u0002\u0002\u0140\u0142",
+    "\u0003\u0002\u0002\u0002\u0141\u0143\u000423\u0002\u0142\u0141\u0003",
+    "\u0002\u0002\u0002\u0143\u0144\u0003\u0002\u0002\u0002\u0144\u0142\u0003",
+    "\u0002\u0002\u0002\u0144\u0145\u0003\u0002\u0002\u0002\u0145\u0147\u0003",
+    "\u0002\u0002\u0002\u0146\u012c\u0003\u0002\u0002\u0002\u0146\u0134\u0003",
+    "\u0002\u0002\u0002\u0146\u013f\u0003\u0002\u0002\u0002\u0147R\u0003",
+    "\u0002\u0002\u0002\u0148\u014a\u00042;\u0002\u0149\u0148\u0003\u0002",
+    "\u0002\u0002\u014a\u014b\u0003\u0002\u0002\u0002\u014b\u0149\u0003\u0002",
+    "\u0002\u0002\u014b\u014c\u0003\u0002\u0002\u0002\u014c\u014d\u0003\u0002",
+    "\u0002\u0002\u014d\u014f\u00070\u0002\u0002\u014e\u0150\u00042;\u0002",
+    "\u014f\u014e\u0003\u0002\u0002\u0002\u0150\u0151\u0003\u0002\u0002\u0002",
+    "\u0151\u014f\u0003\u0002\u0002\u0002\u0151\u0152\u0003\u0002\u0002\u0002",
+    "\u0152T\u0003\u0002\u0002\u0002\u0153\u0158\u0007$\u0002\u0002\u0154",
+    "\u0157\u0005]/\u0002\u0155\u0157\n\u0007\u0002\u0002\u0156\u0154\u0003",
+    "\u0002\u0002\u0002\u0156\u0155\u0003\u0002\u0002\u0002\u0157\u015a\u0003",
+    "\u0002\u0002\u0002\u0158\u0156\u0003\u0002\u0002\u0002\u0158\u0159\u0003",
+    "\u0002\u0002\u0002\u0159\u015b\u0003\u0002\u0002\u0002\u015a\u0158\u0003",
+    "\u0002\u0002\u0002\u015b\u015c\u0007$\u0002\u0002\u015cV\u0003\u0002",
+    "\u0002\u0002\u015d\u0160\u0007)\u0002\u0002\u015e\u0161\u0005]/\u0002",
+    "\u015f\u0161\n\b\u0002\u0002\u0160\u015e\u0003\u0002\u0002\u0002\u0160",
+    "\u015f\u0003\u0002\u0002\u0002\u0161\u0162\u0003\u0002\u0002\u0002\u0162",
+    "\u0163\u0007)\u0002\u0002\u0163X\u0003\u0002\u0002\u0002\u0164\u0165",
+    "\t\t\u0002\u0002\u0165\u0166\u0003\u0002\u0002\u0002\u0166\u0167\b-",
+    "\u0002\u0002\u0167Z\u0003\u0002\u0002\u0002\u0168\u0169\t\n\u0002\u0002",
+    "\u0169\\\u0003\u0002\u0002\u0002\u016a\u016e\u0007^\u0002\u0002\u016b",
+    "\u016f\t\u000b\u0002\u0002\u016c\u016f\u0003\u0002\u0002\u0002\u016d",
+    "\u016f\t\b\u0002\u0002\u016e\u016b\u0003\u0002\u0002\u0002\u016e\u016c",
+    "\u0003\u0002\u0002\u0002\u016e\u016d\u0003\u0002\u0002\u0002\u016f\u0173",
+    "\u0003\u0002\u0002\u0002\u0170\u0173\u0005a1\u0002\u0171\u0173\u0005",
+    "_0\u0002\u0172\u016a\u0003\u0002\u0002\u0002\u0172\u0170\u0003\u0002",
+    "\u0002\u0002\u0172\u0171\u0003\u0002\u0002\u0002\u0173^\u0003\u0002",
+    "\u0002\u0002\u0174\u0175\u0007^\u0002\u0002\u0175\u0176\u000425\u0002",
+    "\u0176\u0177\u000429\u0002\u0177\u017e\u000429\u0002\u0178\u0179\u0007",
+    "^\u0002\u0002\u0179\u017a\u000429\u0002\u017a\u017e\u000429\u0002\u017b",
+    "\u017c\u0007^\u0002\u0002\u017c\u017e\u000429\u0002\u017d\u0174\u0003",
+    "\u0002\u0002\u0002\u017d\u0178\u0003\u0002\u0002\u0002\u017d\u017b\u0003",
+    "\u0002\u0002\u0002\u017e`\u0003\u0002\u0002\u0002\u017f\u0180\u0007",
+    "^\u0002\u0002\u0180\u0181\u0007w\u0002\u0002\u0181\u0182\u0005[.\u0002",
+    "\u0182\u0183\u0005[.\u0002\u0183\u0184\u0005[.\u0002\u0184\u0185\u0005",
+    "[.\u0002\u0185b\u0003\u0002\u0002\u0002\u0186\u0187\u00071\u0002\u0002",
+    "\u0187\u0188\u00071\u0002\u0002\u0188\u018c\u0003\u0002\u0002\u0002",
+    "\u0189\u018b\n\f\u0002\u0002\u018a\u0189\u0003\u0002\u0002\u0002\u018b",
+    "\u018e\u0003\u0002\u0002\u0002\u018c\u018a\u0003\u0002\u0002\u0002\u018c",
+    "\u018d\u0003\u0002\u0002\u0002\u018d\u0190\u0003\u0002\u0002\u0002\u018e",
+    "\u018c\u0003\u0002\u0002\u0002\u018f\u0191\u0007\u000f\u0002\u0002\u0190",
+    "\u018f\u0003\u0002\u0002\u0002\u0190\u0191\u0003\u0002\u0002\u0002\u0191",
+    "\u0192\u0003\u0002\u0002\u0002\u0192\u019f\u0007\f\u0002\u0002\u0193",
+    "\u0194\u00071\u0002\u0002\u0194\u0195\u0007,\u0002\u0002\u0195\u0199",
+    "\u0003\u0002\u0002\u0002\u0196\u0198\u000b\u0002\u0002\u0002\u0197\u0196",
+    "\u0003\u0002\u0002\u0002\u0198\u019b\u0003\u0002\u0002\u0002\u0199\u019a",
+    "\u0003\u0002\u0002\u0002\u0199\u0197\u0003\u0002\u0002\u0002\u019a\u019c",
+    "\u0003\u0002\u0002\u0002\u019b\u0199\u0003\u0002\u0002\u0002\u019c\u019d",
+    "\u0007,\u0002\u0002\u019d\u019f\u00071\u0002\u0002\u019e\u0186\u0003",
+    "\u0002\u0002\u0002\u019e\u0193\u0003\u0002\u0002\u0002\u019f\u01a0\u0003",
+    "\u0002\u0002\u0002\u01a0\u01a1\b2\u0002\u0002\u01a1d\u0003\u0002\u0002",
+    "\u0002\u0018\u0002\u0118\u0122\u0128\u012e\u0134\u0139\u013f\u0144\u0146",
+    "\u014b\u0151\u0156\u0158\u0160\u016e\u0172\u017d\u018c\u0190\u0199\u019e",
+    "\u0003\u0002\u0003\u0002"].join("");
+
+
+var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
+
+var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });
+
+function ivprog(input) {
+	antlr4.Lexer.call(this, input);
+    this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
+    return this;
+}
+
+ivprog.prototype = Object.create(antlr4.Lexer.prototype);
+ivprog.prototype.constructor = ivprog;
+
+Object.defineProperty(ivprog.prototype, "atn", {
+        get : function() {
+                return atn;
+        }
+});
+
+ivprog.EOF = antlr4.Token.EOF;
+ivprog.PR_PROGRAMA = 1;
+ivprog.PR_REAL = 2;
+ivprog.PR_VAZIO = 3;
+ivprog.PR_LOGICO = 4;
+ivprog.PR_CADEIA = 5;
+ivprog.PR_INTEIRO = 6;
+ivprog.PR_CARACTER = 7;
+ivprog.PR_ESCOLHA = 8;
+ivprog.PR_CASO = 9;
+ivprog.PR_CONTRARIO = 10;
+ivprog.PR_CONST = 11;
+ivprog.PR_FUNCAO = 12;
+ivprog.PR_RETORNE = 13;
+ivprog.PR_PARA = 14;
+ivprog.PR_PARE = 15;
+ivprog.PR_FACA = 16;
+ivprog.PR_ENQUANTO = 17;
+ivprog.PR_SE = 18;
+ivprog.PR_SENAO = 19;
+ivprog.GAMBIARRA = 20;
+ivprog.ABRE_PAR = 21;
+ivprog.FECHA_PAR = 22;
+ivprog.ABRE_COL = 23;
+ivprog.FECHA_COL = 24;
+ivprog.ABRE_CHA = 25;
+ivprog.FECHA_CHA = 26;
+ivprog.VIRGULA = 27;
+ivprog.PONTO_VIRGULA = 28;
+ivprog.ATRIBUICAO = 29;
+ivprog.OPERADOR_ARITMETICO = 30;
+ivprog.OPERADOR_E = 31;
+ivprog.OPERADOR_OU = 32;
+ivprog.OPERADOR_RELACIONAL = 33;
+ivprog.DPONTOS = 34;
+ivprog.OPERADOR_NAO = 35;
+ivprog.LOGICO = 36;
+ivprog.ID = 37;
+ivprog.INTEIRO = 38;
+ivprog.REAL = 39;
+ivprog.CADEIA = 40;
+ivprog.CARACTER = 41;
+ivprog.ESPACO = 42;
+ivprog.COMENTARIO = 43;
+
+ivprog.prototype.channelNames = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" ];
+
+ivprog.prototype.modeNames = [ "DEFAULT_MODE" ];
+
+ivprog.prototype.literalNames = [ null, "'programa'", "'real'", "'vazio'", 
+                                  "'logico'", "'cadeia'", "'inteiro'", "'caracter'", 
+                                  "'escolha'", "'caso'", "'contrario'", 
+                                  "'const'", "'funcao'", "'retorne'", "'para'", 
+                                  "'pare'", "'faca'", "'enquanto'", "'se'", 
+                                  "'senao'", null, "'('", "')'", "'['", 
+                                  "']'", "'{'", "'}'", "','", "';'", "'='", 
+                                  null, "'E'", "'OU'", null, "':'", "'nao'" ];
+
+ivprog.prototype.symbolicNames = [ null, "PR_PROGRAMA", "PR_REAL", "PR_VAZIO", 
+                                   "PR_LOGICO", "PR_CADEIA", "PR_INTEIRO", 
+                                   "PR_CARACTER", "PR_ESCOLHA", "PR_CASO", 
+                                   "PR_CONTRARIO", "PR_CONST", "PR_FUNCAO", 
+                                   "PR_RETORNE", "PR_PARA", "PR_PARE", "PR_FACA", 
+                                   "PR_ENQUANTO", "PR_SE", "PR_SENAO", "GAMBIARRA", 
+                                   "ABRE_PAR", "FECHA_PAR", "ABRE_COL", 
+                                   "FECHA_COL", "ABRE_CHA", "FECHA_CHA", 
+                                   "VIRGULA", "PONTO_VIRGULA", "ATRIBUICAO", 
+                                   "OPERADOR_ARITMETICO", "OPERADOR_E", 
+                                   "OPERADOR_OU", "OPERADOR_RELACIONAL", 
+                                   "DPONTOS", "OPERADOR_NAO", "LOGICO", 
+                                   "ID", "INTEIRO", "REAL", "CADEIA", "CARACTER", 
+                                   "ESPACO", "COMENTARIO" ];
+
+ivprog.prototype.ruleNames = [ "PR_PROGRAMA", "PR_REAL", "PR_VAZIO", "PR_LOGICO", 
+                               "PR_CADEIA", "PR_INTEIRO", "PR_CARACTER", 
+                               "PR_ESCOLHA", "PR_CASO", "PR_CONTRARIO", 
+                               "PR_CONST", "PR_FUNCAO", "PR_RETORNE", "PR_PARA", 
+                               "PR_PARE", "PR_FACA", "PR_ENQUANTO", "PR_SE", 
+                               "PR_SENAO", "GAMBIARRA", "PR_FALSO", "PR_VERDADEIRO", 
+                               "ABRE_PAR", "FECHA_PAR", "ABRE_COL", "FECHA_COL", 
+                               "ABRE_CHA", "FECHA_CHA", "VIRGULA", "PONTO_VIRGULA", 
+                               "ATRIBUICAO", "OPERADOR_ARITMETICO", "OPERADOR_E", 
+                               "OPERADOR_OU", "OPERADOR_RELACIONAL", "DPONTOS", 
+                               "OPERADOR_NAO", "LOGICO", "ID", "INTEIRO", 
+                               "REAL", "CADEIA", "CARACTER", "ESPACO", "DIGIT_HEX", 
+                               "SEQ_ESC", "ESC_OCTAL", "ESC_UNICODE", "COMENTARIO" ];
+
+ivprog.prototype.grammarFileName = "ivprog.g4";
+
+
+
+exports.ivprog = ivprog;
+

+ 75 - 0
grammar/pt-br/ivprog.tokens

@@ -0,0 +1,75 @@
+PR_PROGRAMA=1
+PR_REAL=2
+PR_VAZIO=3
+PR_LOGICO=4
+PR_CADEIA=5
+PR_INTEIRO=6
+PR_CARACTER=7
+PR_ESCOLHA=8
+PR_CASO=9
+PR_CONTRARIO=10
+PR_CONST=11
+PR_FUNCAO=12
+PR_RETORNE=13
+PR_PARA=14
+PR_PARE=15
+PR_FACA=16
+PR_ENQUANTO=17
+PR_SE=18
+PR_SENAO=19
+GAMBIARRA=20
+ABRE_PAR=21
+FECHA_PAR=22
+ABRE_COL=23
+FECHA_COL=24
+ABRE_CHA=25
+FECHA_CHA=26
+VIRGULA=27
+PONTO_VIRGULA=28
+ATRIBUICAO=29
+OPERADOR_ARITMETICO=30
+OPERADOR_E=31
+OPERADOR_OU=32
+OPERADOR_RELACIONAL=33
+DPONTOS=34
+OPERADOR_NAO=35
+LOGICO=36
+ID=37
+INTEIRO=38
+REAL=39
+CADEIA=40
+CARACTER=41
+ESPACO=42
+COMENTARIO=43
+'programa'=1
+'real'=2
+'vazio'=3
+'logico'=4
+'cadeia'=5
+'inteiro'=6
+'caracter'=7
+'escolha'=8
+'caso'=9
+'contrario'=10
+'const'=11
+'funcao'=12
+'retorne'=13
+'para'=14
+'pare'=15
+'faca'=16
+'enquanto'=17
+'se'=18
+'senao'=19
+'('=21
+')'=22
+'['=23
+']'=24
+'{'=25
+'}'=26
+','=27
+';'=28
+'='=29
+'E'=31
+'OU'=32
+':'=34
+'nao'=35

+ 5 - 28
js/main.js

@@ -1,33 +1,10 @@
 import { InputStream, CommonTokenStream } from 'antlr4/index';
-import { ivprogParser, ivprogLexer, ivprogVisitor, ivprogListener } from '../grammar/';
+import { pt_br } from '../grammar/';
 
-class MyVisitor extends ivprogVisitor {
- 
-  visitParse(ctx) { console.log(ctx);}
 
-  visitPrograma(ctx) { console.log(ctx);}
-
-  visitListaDeclaracoes(ctx) { console.log(ctx);}
-
-  visitDeclaracoesGlobais(ctx) { console.log(ctx);}
-
-}
-
-class MyListener extends ivprogListener {
-  enterParse(ctx) {
-    console.log(ctx);
-  }
-
-  exitParse(ctx) {
-    console.log(ctx);
-  }
-}
-
-const list = new MyListener();
-const vist = new MyVisitor();
-const input = ""; // Load string content
-const lexer = new ivprogLexer(new InputStream(input));
-const parser = new ivprogParser(new CommonTokenStream(lexer));
-const result = parser.parse().enterRule(list);
+const input = "casa = 35;"; // Load string content
+const lexer = new pt_br(new InputStream(input));
+const parser = new CommonTokenStream(lexer);
+console.log(parser.getTokens(0, 3, null));
 //const result = vist.visit(parser.programa());
 

+ 21 - 7
package-lock.json

@@ -2442,12 +2442,14 @@
         "balanced-match": {
           "version": "1.0.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "brace-expansion": {
           "version": "1.1.11",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "balanced-match": "^1.0.0",
             "concat-map": "0.0.1"
@@ -2462,17 +2464,20 @@
         "code-point-at": {
           "version": "1.1.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "concat-map": {
           "version": "0.0.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "console-control-strings": {
           "version": "1.1.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "core-util-is": {
           "version": "1.0.2",
@@ -2589,7 +2594,8 @@
         "inherits": {
           "version": "2.0.3",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "ini": {
           "version": "1.3.5",
@@ -2601,6 +2607,7 @@
           "version": "1.0.0",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "number-is-nan": "^1.0.0"
           }
@@ -2615,6 +2622,7 @@
           "version": "3.0.4",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "brace-expansion": "^1.1.7"
           }
@@ -2622,12 +2630,14 @@
         "minimist": {
           "version": "0.0.8",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "minipass": {
           "version": "2.2.4",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "safe-buffer": "^5.1.1",
             "yallist": "^3.0.0"
@@ -2646,6 +2656,7 @@
           "version": "0.5.1",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "minimist": "0.0.8"
           }
@@ -2726,7 +2737,8 @@
         "number-is-nan": {
           "version": "1.0.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "object-assign": {
           "version": "4.1.1",
@@ -2738,6 +2750,7 @@
           "version": "1.4.0",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "wrappy": "1"
           }
@@ -2859,6 +2872,7 @@
           "version": "1.0.2",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "code-point-at": "^1.0.0",
             "is-fullwidth-code-point": "^1.0.0",