3314 lines
66 KiB
C#
3314 lines
66 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by a tool.
|
|
// ANTLR Version: 3.4
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
// $ANTLR 3.4 D:\\~Compilador\\!yatc\\Grammar\\tiger.g 2014-03-10 18:42:50
|
|
|
|
// The variable 'variable' is assigned but its value is never used.
|
|
#pragma warning disable 219
|
|
// Unreachable code detected.
|
|
#pragma warning disable 162
|
|
// Missing XML comment for publicly visible type or member 'Type_or_Member'
|
|
#pragma warning disable 1591
|
|
// CLS compliance checking will not be performed on 'type' because it is not visible from outside this assembly.
|
|
#pragma warning disable 3019
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
using Antlr.Runtime;
|
|
using Antlr.Runtime.Misc;
|
|
|
|
namespace YATC.Grammar
|
|
{
|
|
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "3.4")]
|
|
[System.CLSCompliant(false)]
|
|
public partial class tigerLexer : Antlr.Runtime.Lexer
|
|
{
|
|
public const int EOF=-1;
|
|
public const int ALIAS_DECL=4;
|
|
public const int AND=5;
|
|
public const int ARGS_FIELDS=6;
|
|
public const int ARRAYKEY=7;
|
|
public const int ARRAY_ACCESS=8;
|
|
public const int ARRAY_DECL=9;
|
|
public const int ARRAY_INST=10;
|
|
public const int ASCII_ESC=11;
|
|
public const int ASSIGN=12;
|
|
public const int BEGIN_COMMENT=13;
|
|
public const int BREAK=14;
|
|
public const int BREAKKEY=15;
|
|
public const int COLON=16;
|
|
public const int COMMA=17;
|
|
public const int COMMENTARY=18;
|
|
public const int DECL_BLOCK=19;
|
|
public const int DIGIT=20;
|
|
public const int DIV=21;
|
|
public const int DOKEY=22;
|
|
public const int DOT=23;
|
|
public const int ELSEKEY=24;
|
|
public const int ENDKEY=25;
|
|
public const int END_COMMENT=26;
|
|
public const int EQ=27;
|
|
public const int ESC_SEQ=28;
|
|
public const int EXPR_SEQ=29;
|
|
public const int FIELDS_INST=30;
|
|
public const int FIELD_ACCESS=31;
|
|
public const int FIELD_ACCESS_TERMINAL=32;
|
|
public const int FIELD_INST=33;
|
|
public const int FILL_IN_TYPE=34;
|
|
public const int FOR=35;
|
|
public const int FORKEY=36;
|
|
public const int FUNCTIONKEY=37;
|
|
public const int FUN_CALL=38;
|
|
public const int FUN_DECL=39;
|
|
public const int FUN_DECL_SEQ=40;
|
|
public const int FUN_TYPE_WRAPPER=41;
|
|
public const int GT=42;
|
|
public const int GTEQ=43;
|
|
public const int ID=44;
|
|
public const int IF=45;
|
|
public const int IFKEY=46;
|
|
public const int INKEY=47;
|
|
public const int INT=48;
|
|
public const int INTKEY=49;
|
|
public const int LBRACKET=50;
|
|
public const int LET=51;
|
|
public const int LETKEY=52;
|
|
public const int LETTER=53;
|
|
public const int LKEY=54;
|
|
public const int LPAREN=55;
|
|
public const int LT=56;
|
|
public const int LTEQ=57;
|
|
public const int MINUS=58;
|
|
public const int MULT=59;
|
|
public const int NEG=60;
|
|
public const int NIL=61;
|
|
public const int NILKEY=62;
|
|
public const int NOTEQ=63;
|
|
public const int OFKEY=64;
|
|
public const int OR=65;
|
|
public const int PARAM_DECL=66;
|
|
public const int PLUS=67;
|
|
public const int PRINTABLE_CHARACTER=68;
|
|
public const int PROGRAM=69;
|
|
public const int QUOTE=70;
|
|
public const int RBRACKET=71;
|
|
public const int RECORD_DECL=72;
|
|
public const int RECORD_INST=73;
|
|
public const int RKEY=74;
|
|
public const int RPAREN=75;
|
|
public const int SEMI=76;
|
|
public const int STRING=77;
|
|
public const int STRINGKEY=78;
|
|
public const int THENKEY=79;
|
|
public const int TOKEY=80;
|
|
public const int TYPE=81;
|
|
public const int TYPEKEY=82;
|
|
public const int TYPE_DECL=83;
|
|
public const int TYPE_DECL_SEQ=84;
|
|
public const int TYPE_FIELD=85;
|
|
public const int VARKEY=86;
|
|
public const int VAR_ACCESS=87;
|
|
public const int VAR_DECL=88;
|
|
public const int WHILE=89;
|
|
public const int WHILEKEY=90;
|
|
public const int WS=91;
|
|
|
|
public override void ReportError(RecognitionException exc)
|
|
{
|
|
/* Abort on first error. */
|
|
throw new ParsingException(GetErrorMessage(exc, TokenNames), exc);
|
|
}
|
|
|
|
|
|
// delegates
|
|
// delegators
|
|
|
|
public tigerLexer()
|
|
{
|
|
OnCreated();
|
|
}
|
|
|
|
public tigerLexer(ICharStream input )
|
|
: this(input, new RecognizerSharedState())
|
|
{
|
|
}
|
|
|
|
public tigerLexer(ICharStream input, RecognizerSharedState state)
|
|
: base(input, state)
|
|
{
|
|
|
|
OnCreated();
|
|
}
|
|
public override string GrammarFileName { get { return "D:\\~Compilador\\!yatc\\Grammar\\tiger.g"; } }
|
|
|
|
|
|
partial void OnCreated();
|
|
partial void EnterRule(string ruleName, int ruleIndex);
|
|
partial void LeaveRule(string ruleName, int ruleIndex);
|
|
|
|
partial void EnterRule_BEGIN_COMMENT();
|
|
partial void LeaveRule_BEGIN_COMMENT();
|
|
|
|
// $ANTLR start "BEGIN_COMMENT"
|
|
[GrammarRule("BEGIN_COMMENT")]
|
|
private void mBEGIN_COMMENT()
|
|
{
|
|
EnterRule_BEGIN_COMMENT();
|
|
EnterRule("BEGIN_COMMENT", 1);
|
|
TraceIn("BEGIN_COMMENT", 1);
|
|
try
|
|
{
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:103:2: ( '/*' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:103:4: '/*'
|
|
{
|
|
DebugLocation(103, 4);
|
|
Match("/*");
|
|
|
|
|
|
}
|
|
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("BEGIN_COMMENT", 1);
|
|
LeaveRule("BEGIN_COMMENT", 1);
|
|
LeaveRule_BEGIN_COMMENT();
|
|
}
|
|
}
|
|
// $ANTLR end "BEGIN_COMMENT"
|
|
|
|
partial void EnterRule_END_COMMENT();
|
|
partial void LeaveRule_END_COMMENT();
|
|
|
|
// $ANTLR start "END_COMMENT"
|
|
[GrammarRule("END_COMMENT")]
|
|
private void mEND_COMMENT()
|
|
{
|
|
EnterRule_END_COMMENT();
|
|
EnterRule("END_COMMENT", 2);
|
|
TraceIn("END_COMMENT", 2);
|
|
try
|
|
{
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:107:2: ( '*/' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:107:4: '*/'
|
|
{
|
|
DebugLocation(107, 4);
|
|
Match("*/");
|
|
|
|
|
|
}
|
|
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("END_COMMENT", 2);
|
|
LeaveRule("END_COMMENT", 2);
|
|
LeaveRule_END_COMMENT();
|
|
}
|
|
}
|
|
// $ANTLR end "END_COMMENT"
|
|
|
|
partial void EnterRule_PLUS();
|
|
partial void LeaveRule_PLUS();
|
|
|
|
// $ANTLR start "PLUS"
|
|
[GrammarRule("PLUS")]
|
|
private void mPLUS()
|
|
{
|
|
EnterRule_PLUS();
|
|
EnterRule("PLUS", 3);
|
|
TraceIn("PLUS", 3);
|
|
try
|
|
{
|
|
int _type = PLUS;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:111:9: ( '+' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:111:11: '+'
|
|
{
|
|
DebugLocation(111, 11);
|
|
Match('+');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("PLUS", 3);
|
|
LeaveRule("PLUS", 3);
|
|
LeaveRule_PLUS();
|
|
}
|
|
}
|
|
// $ANTLR end "PLUS"
|
|
|
|
partial void EnterRule_MINUS();
|
|
partial void LeaveRule_MINUS();
|
|
|
|
// $ANTLR start "MINUS"
|
|
[GrammarRule("MINUS")]
|
|
private void mMINUS()
|
|
{
|
|
EnterRule_MINUS();
|
|
EnterRule("MINUS", 4);
|
|
TraceIn("MINUS", 4);
|
|
try
|
|
{
|
|
int _type = MINUS;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:112:9: ( '-' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:112:11: '-'
|
|
{
|
|
DebugLocation(112, 11);
|
|
Match('-');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("MINUS", 4);
|
|
LeaveRule("MINUS", 4);
|
|
LeaveRule_MINUS();
|
|
}
|
|
}
|
|
// $ANTLR end "MINUS"
|
|
|
|
partial void EnterRule_MULT();
|
|
partial void LeaveRule_MULT();
|
|
|
|
// $ANTLR start "MULT"
|
|
[GrammarRule("MULT")]
|
|
private void mMULT()
|
|
{
|
|
EnterRule_MULT();
|
|
EnterRule("MULT", 5);
|
|
TraceIn("MULT", 5);
|
|
try
|
|
{
|
|
int _type = MULT;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:113:9: ( '*' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:113:11: '*'
|
|
{
|
|
DebugLocation(113, 11);
|
|
Match('*');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("MULT", 5);
|
|
LeaveRule("MULT", 5);
|
|
LeaveRule_MULT();
|
|
}
|
|
}
|
|
// $ANTLR end "MULT"
|
|
|
|
partial void EnterRule_DIV();
|
|
partial void LeaveRule_DIV();
|
|
|
|
// $ANTLR start "DIV"
|
|
[GrammarRule("DIV")]
|
|
private void mDIV()
|
|
{
|
|
EnterRule_DIV();
|
|
EnterRule("DIV", 6);
|
|
TraceIn("DIV", 6);
|
|
try
|
|
{
|
|
int _type = DIV;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:114:9: ( '/' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:114:11: '/'
|
|
{
|
|
DebugLocation(114, 11);
|
|
Match('/');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("DIV", 6);
|
|
LeaveRule("DIV", 6);
|
|
LeaveRule_DIV();
|
|
}
|
|
}
|
|
// $ANTLR end "DIV"
|
|
|
|
partial void EnterRule_EQ();
|
|
partial void LeaveRule_EQ();
|
|
|
|
// $ANTLR start "EQ"
|
|
[GrammarRule("EQ")]
|
|
private void mEQ()
|
|
{
|
|
EnterRule_EQ();
|
|
EnterRule("EQ", 7);
|
|
TraceIn("EQ", 7);
|
|
try
|
|
{
|
|
int _type = EQ;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:117:9: ( '=' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:117:11: '='
|
|
{
|
|
DebugLocation(117, 11);
|
|
Match('=');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("EQ", 7);
|
|
LeaveRule("EQ", 7);
|
|
LeaveRule_EQ();
|
|
}
|
|
}
|
|
// $ANTLR end "EQ"
|
|
|
|
partial void EnterRule_NOTEQ();
|
|
partial void LeaveRule_NOTEQ();
|
|
|
|
// $ANTLR start "NOTEQ"
|
|
[GrammarRule("NOTEQ")]
|
|
private void mNOTEQ()
|
|
{
|
|
EnterRule_NOTEQ();
|
|
EnterRule("NOTEQ", 8);
|
|
TraceIn("NOTEQ", 8);
|
|
try
|
|
{
|
|
int _type = NOTEQ;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:118:9: ( '<>' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:118:11: '<>'
|
|
{
|
|
DebugLocation(118, 11);
|
|
Match("<>");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("NOTEQ", 8);
|
|
LeaveRule("NOTEQ", 8);
|
|
LeaveRule_NOTEQ();
|
|
}
|
|
}
|
|
// $ANTLR end "NOTEQ"
|
|
|
|
partial void EnterRule_GT();
|
|
partial void LeaveRule_GT();
|
|
|
|
// $ANTLR start "GT"
|
|
[GrammarRule("GT")]
|
|
private void mGT()
|
|
{
|
|
EnterRule_GT();
|
|
EnterRule("GT", 9);
|
|
TraceIn("GT", 9);
|
|
try
|
|
{
|
|
int _type = GT;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:119:9: ( '>' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:119:11: '>'
|
|
{
|
|
DebugLocation(119, 11);
|
|
Match('>');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("GT", 9);
|
|
LeaveRule("GT", 9);
|
|
LeaveRule_GT();
|
|
}
|
|
}
|
|
// $ANTLR end "GT"
|
|
|
|
partial void EnterRule_GTEQ();
|
|
partial void LeaveRule_GTEQ();
|
|
|
|
// $ANTLR start "GTEQ"
|
|
[GrammarRule("GTEQ")]
|
|
private void mGTEQ()
|
|
{
|
|
EnterRule_GTEQ();
|
|
EnterRule("GTEQ", 10);
|
|
TraceIn("GTEQ", 10);
|
|
try
|
|
{
|
|
int _type = GTEQ;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:120:9: ( '>=' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:120:11: '>='
|
|
{
|
|
DebugLocation(120, 11);
|
|
Match(">=");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("GTEQ", 10);
|
|
LeaveRule("GTEQ", 10);
|
|
LeaveRule_GTEQ();
|
|
}
|
|
}
|
|
// $ANTLR end "GTEQ"
|
|
|
|
partial void EnterRule_LT();
|
|
partial void LeaveRule_LT();
|
|
|
|
// $ANTLR start "LT"
|
|
[GrammarRule("LT")]
|
|
private void mLT()
|
|
{
|
|
EnterRule_LT();
|
|
EnterRule("LT", 11);
|
|
TraceIn("LT", 11);
|
|
try
|
|
{
|
|
int _type = LT;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:121:9: ( '<' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:121:11: '<'
|
|
{
|
|
DebugLocation(121, 11);
|
|
Match('<');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("LT", 11);
|
|
LeaveRule("LT", 11);
|
|
LeaveRule_LT();
|
|
}
|
|
}
|
|
// $ANTLR end "LT"
|
|
|
|
partial void EnterRule_LTEQ();
|
|
partial void LeaveRule_LTEQ();
|
|
|
|
// $ANTLR start "LTEQ"
|
|
[GrammarRule("LTEQ")]
|
|
private void mLTEQ()
|
|
{
|
|
EnterRule_LTEQ();
|
|
EnterRule("LTEQ", 12);
|
|
TraceIn("LTEQ", 12);
|
|
try
|
|
{
|
|
int _type = LTEQ;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:122:9: ( '<=' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:122:11: '<='
|
|
{
|
|
DebugLocation(122, 11);
|
|
Match("<=");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("LTEQ", 12);
|
|
LeaveRule("LTEQ", 12);
|
|
LeaveRule_LTEQ();
|
|
}
|
|
}
|
|
// $ANTLR end "LTEQ"
|
|
|
|
partial void EnterRule_AND();
|
|
partial void LeaveRule_AND();
|
|
|
|
// $ANTLR start "AND"
|
|
[GrammarRule("AND")]
|
|
private void mAND()
|
|
{
|
|
EnterRule_AND();
|
|
EnterRule("AND", 13);
|
|
TraceIn("AND", 13);
|
|
try
|
|
{
|
|
int _type = AND;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:125:9: ( '&' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:125:11: '&'
|
|
{
|
|
DebugLocation(125, 11);
|
|
Match('&');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("AND", 13);
|
|
LeaveRule("AND", 13);
|
|
LeaveRule_AND();
|
|
}
|
|
}
|
|
// $ANTLR end "AND"
|
|
|
|
partial void EnterRule_OR();
|
|
partial void LeaveRule_OR();
|
|
|
|
// $ANTLR start "OR"
|
|
[GrammarRule("OR")]
|
|
private void mOR()
|
|
{
|
|
EnterRule_OR();
|
|
EnterRule("OR", 14);
|
|
TraceIn("OR", 14);
|
|
try
|
|
{
|
|
int _type = OR;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:126:9: ( '|' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:126:11: '|'
|
|
{
|
|
DebugLocation(126, 11);
|
|
Match('|');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("OR", 14);
|
|
LeaveRule("OR", 14);
|
|
LeaveRule_OR();
|
|
}
|
|
}
|
|
// $ANTLR end "OR"
|
|
|
|
partial void EnterRule_LPAREN();
|
|
partial void LeaveRule_LPAREN();
|
|
|
|
// $ANTLR start "LPAREN"
|
|
[GrammarRule("LPAREN")]
|
|
private void mLPAREN()
|
|
{
|
|
EnterRule_LPAREN();
|
|
EnterRule("LPAREN", 15);
|
|
TraceIn("LPAREN", 15);
|
|
try
|
|
{
|
|
int _type = LPAREN;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:129:8: ( '(' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:129:10: '('
|
|
{
|
|
DebugLocation(129, 10);
|
|
Match('(');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("LPAREN", 15);
|
|
LeaveRule("LPAREN", 15);
|
|
LeaveRule_LPAREN();
|
|
}
|
|
}
|
|
// $ANTLR end "LPAREN"
|
|
|
|
partial void EnterRule_RPAREN();
|
|
partial void LeaveRule_RPAREN();
|
|
|
|
// $ANTLR start "RPAREN"
|
|
[GrammarRule("RPAREN")]
|
|
private void mRPAREN()
|
|
{
|
|
EnterRule_RPAREN();
|
|
EnterRule("RPAREN", 16);
|
|
TraceIn("RPAREN", 16);
|
|
try
|
|
{
|
|
int _type = RPAREN;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:130:8: ( ')' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:130:10: ')'
|
|
{
|
|
DebugLocation(130, 10);
|
|
Match(')');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("RPAREN", 16);
|
|
LeaveRule("RPAREN", 16);
|
|
LeaveRule_RPAREN();
|
|
}
|
|
}
|
|
// $ANTLR end "RPAREN"
|
|
|
|
partial void EnterRule_LBRACKET();
|
|
partial void LeaveRule_LBRACKET();
|
|
|
|
// $ANTLR start "LBRACKET"
|
|
[GrammarRule("LBRACKET")]
|
|
private void mLBRACKET()
|
|
{
|
|
EnterRule_LBRACKET();
|
|
EnterRule("LBRACKET", 17);
|
|
TraceIn("LBRACKET", 17);
|
|
try
|
|
{
|
|
int _type = LBRACKET;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:131:11: ( '[' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:131:13: '['
|
|
{
|
|
DebugLocation(131, 13);
|
|
Match('[');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("LBRACKET", 17);
|
|
LeaveRule("LBRACKET", 17);
|
|
LeaveRule_LBRACKET();
|
|
}
|
|
}
|
|
// $ANTLR end "LBRACKET"
|
|
|
|
partial void EnterRule_RBRACKET();
|
|
partial void LeaveRule_RBRACKET();
|
|
|
|
// $ANTLR start "RBRACKET"
|
|
[GrammarRule("RBRACKET")]
|
|
private void mRBRACKET()
|
|
{
|
|
EnterRule_RBRACKET();
|
|
EnterRule("RBRACKET", 18);
|
|
TraceIn("RBRACKET", 18);
|
|
try
|
|
{
|
|
int _type = RBRACKET;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:132:11: ( ']' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:132:13: ']'
|
|
{
|
|
DebugLocation(132, 13);
|
|
Match(']');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("RBRACKET", 18);
|
|
LeaveRule("RBRACKET", 18);
|
|
LeaveRule_RBRACKET();
|
|
}
|
|
}
|
|
// $ANTLR end "RBRACKET"
|
|
|
|
partial void EnterRule_LKEY();
|
|
partial void LeaveRule_LKEY();
|
|
|
|
// $ANTLR start "LKEY"
|
|
[GrammarRule("LKEY")]
|
|
private void mLKEY()
|
|
{
|
|
EnterRule_LKEY();
|
|
EnterRule("LKEY", 19);
|
|
TraceIn("LKEY", 19);
|
|
try
|
|
{
|
|
int _type = LKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:133:9: ( '{' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:133:11: '{'
|
|
{
|
|
DebugLocation(133, 11);
|
|
Match('{');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("LKEY", 19);
|
|
LeaveRule("LKEY", 19);
|
|
LeaveRule_LKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "LKEY"
|
|
|
|
partial void EnterRule_RKEY();
|
|
partial void LeaveRule_RKEY();
|
|
|
|
// $ANTLR start "RKEY"
|
|
[GrammarRule("RKEY")]
|
|
private void mRKEY()
|
|
{
|
|
EnterRule_RKEY();
|
|
EnterRule("RKEY", 20);
|
|
TraceIn("RKEY", 20);
|
|
try
|
|
{
|
|
int _type = RKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:134:9: ( '}' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:134:11: '}'
|
|
{
|
|
DebugLocation(134, 11);
|
|
Match('}');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("RKEY", 20);
|
|
LeaveRule("RKEY", 20);
|
|
LeaveRule_RKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "RKEY"
|
|
|
|
partial void EnterRule_COMMA();
|
|
partial void LeaveRule_COMMA();
|
|
|
|
// $ANTLR start "COMMA"
|
|
[GrammarRule("COMMA")]
|
|
private void mCOMMA()
|
|
{
|
|
EnterRule_COMMA();
|
|
EnterRule("COMMA", 21);
|
|
TraceIn("COMMA", 21);
|
|
try
|
|
{
|
|
int _type = COMMA;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:137:7: ( ',' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:137:9: ','
|
|
{
|
|
DebugLocation(137, 9);
|
|
Match(',');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("COMMA", 21);
|
|
LeaveRule("COMMA", 21);
|
|
LeaveRule_COMMA();
|
|
}
|
|
}
|
|
// $ANTLR end "COMMA"
|
|
|
|
partial void EnterRule_SEMI();
|
|
partial void LeaveRule_SEMI();
|
|
|
|
// $ANTLR start "SEMI"
|
|
[GrammarRule("SEMI")]
|
|
private void mSEMI()
|
|
{
|
|
EnterRule_SEMI();
|
|
EnterRule("SEMI", 22);
|
|
TraceIn("SEMI", 22);
|
|
try
|
|
{
|
|
int _type = SEMI;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:138:6: ( ';' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:138:8: ';'
|
|
{
|
|
DebugLocation(138, 8);
|
|
Match(';');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("SEMI", 22);
|
|
LeaveRule("SEMI", 22);
|
|
LeaveRule_SEMI();
|
|
}
|
|
}
|
|
// $ANTLR end "SEMI"
|
|
|
|
partial void EnterRule_COLON();
|
|
partial void LeaveRule_COLON();
|
|
|
|
// $ANTLR start "COLON"
|
|
[GrammarRule("COLON")]
|
|
private void mCOLON()
|
|
{
|
|
EnterRule_COLON();
|
|
EnterRule("COLON", 23);
|
|
TraceIn("COLON", 23);
|
|
try
|
|
{
|
|
int _type = COLON;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:139:9: ( ':' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:139:11: ':'
|
|
{
|
|
DebugLocation(139, 11);
|
|
Match(':');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("COLON", 23);
|
|
LeaveRule("COLON", 23);
|
|
LeaveRule_COLON();
|
|
}
|
|
}
|
|
// $ANTLR end "COLON"
|
|
|
|
partial void EnterRule_DOT();
|
|
partial void LeaveRule_DOT();
|
|
|
|
// $ANTLR start "DOT"
|
|
[GrammarRule("DOT")]
|
|
private void mDOT()
|
|
{
|
|
EnterRule_DOT();
|
|
EnterRule("DOT", 24);
|
|
TraceIn("DOT", 24);
|
|
try
|
|
{
|
|
int _type = DOT;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:140:9: ( '.' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:140:11: '.'
|
|
{
|
|
DebugLocation(140, 11);
|
|
Match('.');
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("DOT", 24);
|
|
LeaveRule("DOT", 24);
|
|
LeaveRule_DOT();
|
|
}
|
|
}
|
|
// $ANTLR end "DOT"
|
|
|
|
partial void EnterRule_QUOTE();
|
|
partial void LeaveRule_QUOTE();
|
|
|
|
// $ANTLR start "QUOTE"
|
|
[GrammarRule("QUOTE")]
|
|
private void mQUOTE()
|
|
{
|
|
EnterRule_QUOTE();
|
|
EnterRule("QUOTE", 25);
|
|
TraceIn("QUOTE", 25);
|
|
try
|
|
{
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:143:9: ( '\\\"' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:143:11: '\\\"'
|
|
{
|
|
DebugLocation(143, 11);
|
|
Match('\"');
|
|
|
|
}
|
|
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("QUOTE", 25);
|
|
LeaveRule("QUOTE", 25);
|
|
LeaveRule_QUOTE();
|
|
}
|
|
}
|
|
// $ANTLR end "QUOTE"
|
|
|
|
partial void EnterRule_ASSIGN();
|
|
partial void LeaveRule_ASSIGN();
|
|
|
|
// $ANTLR start "ASSIGN"
|
|
[GrammarRule("ASSIGN")]
|
|
private void mASSIGN()
|
|
{
|
|
EnterRule_ASSIGN();
|
|
EnterRule("ASSIGN", 26);
|
|
TraceIn("ASSIGN", 26);
|
|
try
|
|
{
|
|
int _type = ASSIGN;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:144:9: ( ':=' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:144:11: ':='
|
|
{
|
|
DebugLocation(144, 11);
|
|
Match(":=");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("ASSIGN", 26);
|
|
LeaveRule("ASSIGN", 26);
|
|
LeaveRule_ASSIGN();
|
|
}
|
|
}
|
|
// $ANTLR end "ASSIGN"
|
|
|
|
partial void EnterRule_ARRAYKEY();
|
|
partial void LeaveRule_ARRAYKEY();
|
|
|
|
// $ANTLR start "ARRAYKEY"
|
|
[GrammarRule("ARRAYKEY")]
|
|
private void mARRAYKEY()
|
|
{
|
|
EnterRule_ARRAYKEY();
|
|
EnterRule("ARRAYKEY", 27);
|
|
TraceIn("ARRAYKEY", 27);
|
|
try
|
|
{
|
|
int _type = ARRAYKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:147:13: ( 'array' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:147:15: 'array'
|
|
{
|
|
DebugLocation(147, 15);
|
|
Match("array");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("ARRAYKEY", 27);
|
|
LeaveRule("ARRAYKEY", 27);
|
|
LeaveRule_ARRAYKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "ARRAYKEY"
|
|
|
|
partial void EnterRule_BREAKKEY();
|
|
partial void LeaveRule_BREAKKEY();
|
|
|
|
// $ANTLR start "BREAKKEY"
|
|
[GrammarRule("BREAKKEY")]
|
|
private void mBREAKKEY()
|
|
{
|
|
EnterRule_BREAKKEY();
|
|
EnterRule("BREAKKEY", 28);
|
|
TraceIn("BREAKKEY", 28);
|
|
try
|
|
{
|
|
int _type = BREAKKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:148:13: ( 'break' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:148:15: 'break'
|
|
{
|
|
DebugLocation(148, 15);
|
|
Match("break");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("BREAKKEY", 28);
|
|
LeaveRule("BREAKKEY", 28);
|
|
LeaveRule_BREAKKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "BREAKKEY"
|
|
|
|
partial void EnterRule_DOKEY();
|
|
partial void LeaveRule_DOKEY();
|
|
|
|
// $ANTLR start "DOKEY"
|
|
[GrammarRule("DOKEY")]
|
|
private void mDOKEY()
|
|
{
|
|
EnterRule_DOKEY();
|
|
EnterRule("DOKEY", 29);
|
|
TraceIn("DOKEY", 29);
|
|
try
|
|
{
|
|
int _type = DOKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:149:13: ( 'do' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:149:15: 'do'
|
|
{
|
|
DebugLocation(149, 15);
|
|
Match("do");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("DOKEY", 29);
|
|
LeaveRule("DOKEY", 29);
|
|
LeaveRule_DOKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "DOKEY"
|
|
|
|
partial void EnterRule_ELSEKEY();
|
|
partial void LeaveRule_ELSEKEY();
|
|
|
|
// $ANTLR start "ELSEKEY"
|
|
[GrammarRule("ELSEKEY")]
|
|
private void mELSEKEY()
|
|
{
|
|
EnterRule_ELSEKEY();
|
|
EnterRule("ELSEKEY", 30);
|
|
TraceIn("ELSEKEY", 30);
|
|
try
|
|
{
|
|
int _type = ELSEKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:150:13: ( 'else' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:150:15: 'else'
|
|
{
|
|
DebugLocation(150, 15);
|
|
Match("else");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("ELSEKEY", 30);
|
|
LeaveRule("ELSEKEY", 30);
|
|
LeaveRule_ELSEKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "ELSEKEY"
|
|
|
|
partial void EnterRule_ENDKEY();
|
|
partial void LeaveRule_ENDKEY();
|
|
|
|
// $ANTLR start "ENDKEY"
|
|
[GrammarRule("ENDKEY")]
|
|
private void mENDKEY()
|
|
{
|
|
EnterRule_ENDKEY();
|
|
EnterRule("ENDKEY", 31);
|
|
TraceIn("ENDKEY", 31);
|
|
try
|
|
{
|
|
int _type = ENDKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:151:13: ( 'end' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:151:15: 'end'
|
|
{
|
|
DebugLocation(151, 15);
|
|
Match("end");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("ENDKEY", 31);
|
|
LeaveRule("ENDKEY", 31);
|
|
LeaveRule_ENDKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "ENDKEY"
|
|
|
|
partial void EnterRule_FORKEY();
|
|
partial void LeaveRule_FORKEY();
|
|
|
|
// $ANTLR start "FORKEY"
|
|
[GrammarRule("FORKEY")]
|
|
private void mFORKEY()
|
|
{
|
|
EnterRule_FORKEY();
|
|
EnterRule("FORKEY", 32);
|
|
TraceIn("FORKEY", 32);
|
|
try
|
|
{
|
|
int _type = FORKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:152:13: ( 'for' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:152:15: 'for'
|
|
{
|
|
DebugLocation(152, 15);
|
|
Match("for");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("FORKEY", 32);
|
|
LeaveRule("FORKEY", 32);
|
|
LeaveRule_FORKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "FORKEY"
|
|
|
|
partial void EnterRule_FUNCTIONKEY();
|
|
partial void LeaveRule_FUNCTIONKEY();
|
|
|
|
// $ANTLR start "FUNCTIONKEY"
|
|
[GrammarRule("FUNCTIONKEY")]
|
|
private void mFUNCTIONKEY()
|
|
{
|
|
EnterRule_FUNCTIONKEY();
|
|
EnterRule("FUNCTIONKEY", 33);
|
|
TraceIn("FUNCTIONKEY", 33);
|
|
try
|
|
{
|
|
int _type = FUNCTIONKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:153:13: ( 'function' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:153:15: 'function'
|
|
{
|
|
DebugLocation(153, 15);
|
|
Match("function");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("FUNCTIONKEY", 33);
|
|
LeaveRule("FUNCTIONKEY", 33);
|
|
LeaveRule_FUNCTIONKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "FUNCTIONKEY"
|
|
|
|
partial void EnterRule_IFKEY();
|
|
partial void LeaveRule_IFKEY();
|
|
|
|
// $ANTLR start "IFKEY"
|
|
[GrammarRule("IFKEY")]
|
|
private void mIFKEY()
|
|
{
|
|
EnterRule_IFKEY();
|
|
EnterRule("IFKEY", 34);
|
|
TraceIn("IFKEY", 34);
|
|
try
|
|
{
|
|
int _type = IFKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:154:13: ( 'if' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:154:15: 'if'
|
|
{
|
|
DebugLocation(154, 15);
|
|
Match("if");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("IFKEY", 34);
|
|
LeaveRule("IFKEY", 34);
|
|
LeaveRule_IFKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "IFKEY"
|
|
|
|
partial void EnterRule_INKEY();
|
|
partial void LeaveRule_INKEY();
|
|
|
|
// $ANTLR start "INKEY"
|
|
[GrammarRule("INKEY")]
|
|
private void mINKEY()
|
|
{
|
|
EnterRule_INKEY();
|
|
EnterRule("INKEY", 35);
|
|
TraceIn("INKEY", 35);
|
|
try
|
|
{
|
|
int _type = INKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:155:13: ( 'in' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:155:15: 'in'
|
|
{
|
|
DebugLocation(155, 15);
|
|
Match("in");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("INKEY", 35);
|
|
LeaveRule("INKEY", 35);
|
|
LeaveRule_INKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "INKEY"
|
|
|
|
partial void EnterRule_INTKEY();
|
|
partial void LeaveRule_INTKEY();
|
|
|
|
// $ANTLR start "INTKEY"
|
|
[GrammarRule("INTKEY")]
|
|
private void mINTKEY()
|
|
{
|
|
EnterRule_INTKEY();
|
|
EnterRule("INTKEY", 36);
|
|
TraceIn("INTKEY", 36);
|
|
try
|
|
{
|
|
int _type = INTKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:156:9: ( 'int' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:156:11: 'int'
|
|
{
|
|
DebugLocation(156, 11);
|
|
Match("int");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("INTKEY", 36);
|
|
LeaveRule("INTKEY", 36);
|
|
LeaveRule_INTKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "INTKEY"
|
|
|
|
partial void EnterRule_LETKEY();
|
|
partial void LeaveRule_LETKEY();
|
|
|
|
// $ANTLR start "LETKEY"
|
|
[GrammarRule("LETKEY")]
|
|
private void mLETKEY()
|
|
{
|
|
EnterRule_LETKEY();
|
|
EnterRule("LETKEY", 37);
|
|
TraceIn("LETKEY", 37);
|
|
try
|
|
{
|
|
int _type = LETKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:157:13: ( 'let' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:157:15: 'let'
|
|
{
|
|
DebugLocation(157, 15);
|
|
Match("let");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("LETKEY", 37);
|
|
LeaveRule("LETKEY", 37);
|
|
LeaveRule_LETKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "LETKEY"
|
|
|
|
partial void EnterRule_NILKEY();
|
|
partial void LeaveRule_NILKEY();
|
|
|
|
// $ANTLR start "NILKEY"
|
|
[GrammarRule("NILKEY")]
|
|
private void mNILKEY()
|
|
{
|
|
EnterRule_NILKEY();
|
|
EnterRule("NILKEY", 38);
|
|
TraceIn("NILKEY", 38);
|
|
try
|
|
{
|
|
int _type = NILKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:158:13: ( 'nil' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:158:15: 'nil'
|
|
{
|
|
DebugLocation(158, 15);
|
|
Match("nil");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("NILKEY", 38);
|
|
LeaveRule("NILKEY", 38);
|
|
LeaveRule_NILKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "NILKEY"
|
|
|
|
partial void EnterRule_OFKEY();
|
|
partial void LeaveRule_OFKEY();
|
|
|
|
// $ANTLR start "OFKEY"
|
|
[GrammarRule("OFKEY")]
|
|
private void mOFKEY()
|
|
{
|
|
EnterRule_OFKEY();
|
|
EnterRule("OFKEY", 39);
|
|
TraceIn("OFKEY", 39);
|
|
try
|
|
{
|
|
int _type = OFKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:159:13: ( 'of' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:159:15: 'of'
|
|
{
|
|
DebugLocation(159, 15);
|
|
Match("of");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("OFKEY", 39);
|
|
LeaveRule("OFKEY", 39);
|
|
LeaveRule_OFKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "OFKEY"
|
|
|
|
partial void EnterRule_STRINGKEY();
|
|
partial void LeaveRule_STRINGKEY();
|
|
|
|
// $ANTLR start "STRINGKEY"
|
|
[GrammarRule("STRINGKEY")]
|
|
private void mSTRINGKEY()
|
|
{
|
|
EnterRule_STRINGKEY();
|
|
EnterRule("STRINGKEY", 40);
|
|
TraceIn("STRINGKEY", 40);
|
|
try
|
|
{
|
|
int _type = STRINGKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:160:11: ( 'string' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:160:13: 'string'
|
|
{
|
|
DebugLocation(160, 13);
|
|
Match("string");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("STRINGKEY", 40);
|
|
LeaveRule("STRINGKEY", 40);
|
|
LeaveRule_STRINGKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "STRINGKEY"
|
|
|
|
partial void EnterRule_THENKEY();
|
|
partial void LeaveRule_THENKEY();
|
|
|
|
// $ANTLR start "THENKEY"
|
|
[GrammarRule("THENKEY")]
|
|
private void mTHENKEY()
|
|
{
|
|
EnterRule_THENKEY();
|
|
EnterRule("THENKEY", 41);
|
|
TraceIn("THENKEY", 41);
|
|
try
|
|
{
|
|
int _type = THENKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:161:13: ( 'then' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:161:15: 'then'
|
|
{
|
|
DebugLocation(161, 15);
|
|
Match("then");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("THENKEY", 41);
|
|
LeaveRule("THENKEY", 41);
|
|
LeaveRule_THENKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "THENKEY"
|
|
|
|
partial void EnterRule_TOKEY();
|
|
partial void LeaveRule_TOKEY();
|
|
|
|
// $ANTLR start "TOKEY"
|
|
[GrammarRule("TOKEY")]
|
|
private void mTOKEY()
|
|
{
|
|
EnterRule_TOKEY();
|
|
EnterRule("TOKEY", 42);
|
|
TraceIn("TOKEY", 42);
|
|
try
|
|
{
|
|
int _type = TOKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:162:13: ( 'to' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:162:15: 'to'
|
|
{
|
|
DebugLocation(162, 15);
|
|
Match("to");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("TOKEY", 42);
|
|
LeaveRule("TOKEY", 42);
|
|
LeaveRule_TOKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "TOKEY"
|
|
|
|
partial void EnterRule_TYPEKEY();
|
|
partial void LeaveRule_TYPEKEY();
|
|
|
|
// $ANTLR start "TYPEKEY"
|
|
[GrammarRule("TYPEKEY")]
|
|
private void mTYPEKEY()
|
|
{
|
|
EnterRule_TYPEKEY();
|
|
EnterRule("TYPEKEY", 43);
|
|
TraceIn("TYPEKEY", 43);
|
|
try
|
|
{
|
|
int _type = TYPEKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:163:13: ( 'type' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:163:15: 'type'
|
|
{
|
|
DebugLocation(163, 15);
|
|
Match("type");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("TYPEKEY", 43);
|
|
LeaveRule("TYPEKEY", 43);
|
|
LeaveRule_TYPEKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "TYPEKEY"
|
|
|
|
partial void EnterRule_VARKEY();
|
|
partial void LeaveRule_VARKEY();
|
|
|
|
// $ANTLR start "VARKEY"
|
|
[GrammarRule("VARKEY")]
|
|
private void mVARKEY()
|
|
{
|
|
EnterRule_VARKEY();
|
|
EnterRule("VARKEY", 44);
|
|
TraceIn("VARKEY", 44);
|
|
try
|
|
{
|
|
int _type = VARKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:164:13: ( 'var' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:164:15: 'var'
|
|
{
|
|
DebugLocation(164, 15);
|
|
Match("var");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("VARKEY", 44);
|
|
LeaveRule("VARKEY", 44);
|
|
LeaveRule_VARKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "VARKEY"
|
|
|
|
partial void EnterRule_WHILEKEY();
|
|
partial void LeaveRule_WHILEKEY();
|
|
|
|
// $ANTLR start "WHILEKEY"
|
|
[GrammarRule("WHILEKEY")]
|
|
private void mWHILEKEY()
|
|
{
|
|
EnterRule_WHILEKEY();
|
|
EnterRule("WHILEKEY", 45);
|
|
TraceIn("WHILEKEY", 45);
|
|
try
|
|
{
|
|
int _type = WHILEKEY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:165:13: ( 'while' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:165:15: 'while'
|
|
{
|
|
DebugLocation(165, 15);
|
|
Match("while");
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("WHILEKEY", 45);
|
|
LeaveRule("WHILEKEY", 45);
|
|
LeaveRule_WHILEKEY();
|
|
}
|
|
}
|
|
// $ANTLR end "WHILEKEY"
|
|
|
|
partial void EnterRule_DIGIT();
|
|
partial void LeaveRule_DIGIT();
|
|
|
|
// $ANTLR start "DIGIT"
|
|
[GrammarRule("DIGIT")]
|
|
private void mDIGIT()
|
|
{
|
|
EnterRule_DIGIT();
|
|
EnterRule("DIGIT", 46);
|
|
TraceIn("DIGIT", 46);
|
|
try
|
|
{
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:170:2: ( '0' .. '9' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:
|
|
{
|
|
DebugLocation(170, 2);
|
|
if ((input.LA(1)>='0' && input.LA(1)<='9'))
|
|
{
|
|
input.Consume();
|
|
}
|
|
else
|
|
{
|
|
MismatchedSetException mse = new MismatchedSetException(null,input);
|
|
DebugRecognitionException(mse);
|
|
Recover(mse);
|
|
throw mse;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("DIGIT", 46);
|
|
LeaveRule("DIGIT", 46);
|
|
LeaveRule_DIGIT();
|
|
}
|
|
}
|
|
// $ANTLR end "DIGIT"
|
|
|
|
partial void EnterRule_LETTER();
|
|
partial void LeaveRule_LETTER();
|
|
|
|
// $ANTLR start "LETTER"
|
|
[GrammarRule("LETTER")]
|
|
private void mLETTER()
|
|
{
|
|
EnterRule_LETTER();
|
|
EnterRule("LETTER", 47);
|
|
TraceIn("LETTER", 47);
|
|
try
|
|
{
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:175:2: ( 'a' .. 'z' | 'A' .. 'Z' )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:
|
|
{
|
|
DebugLocation(175, 2);
|
|
if ((input.LA(1)>='A' && input.LA(1)<='Z')||(input.LA(1)>='a' && input.LA(1)<='z'))
|
|
{
|
|
input.Consume();
|
|
}
|
|
else
|
|
{
|
|
MismatchedSetException mse = new MismatchedSetException(null,input);
|
|
DebugRecognitionException(mse);
|
|
Recover(mse);
|
|
throw mse;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("LETTER", 47);
|
|
LeaveRule("LETTER", 47);
|
|
LeaveRule_LETTER();
|
|
}
|
|
}
|
|
// $ANTLR end "LETTER"
|
|
|
|
partial void EnterRule_ASCII_ESC();
|
|
partial void LeaveRule_ASCII_ESC();
|
|
|
|
// $ANTLR start "ASCII_ESC"
|
|
[GrammarRule("ASCII_ESC")]
|
|
private void mASCII_ESC()
|
|
{
|
|
EnterRule_ASCII_ESC();
|
|
EnterRule("ASCII_ESC", 48);
|
|
TraceIn("ASCII_ESC", 48);
|
|
try
|
|
{
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:180:2: ( '12' '0' .. '7' | '1' '0' .. '1' '0' .. '9' | '0' '0' .. '9' '0' .. '9' )
|
|
int alt1=3;
|
|
try { DebugEnterDecision(1, false);
|
|
int LA1_0 = input.LA(1);
|
|
|
|
if ((LA1_0=='1'))
|
|
{
|
|
int LA1_1 = input.LA(2);
|
|
|
|
if ((LA1_1=='2'))
|
|
{
|
|
alt1 = 1;
|
|
}
|
|
else if (((LA1_1>='0' && LA1_1<='1')))
|
|
{
|
|
alt1 = 2;
|
|
}
|
|
else
|
|
{
|
|
NoViableAltException nvae = new NoViableAltException("", 1, 1, input);
|
|
DebugRecognitionException(nvae);
|
|
throw nvae;
|
|
}
|
|
}
|
|
else if ((LA1_0=='0'))
|
|
{
|
|
alt1 = 3;
|
|
}
|
|
else
|
|
{
|
|
NoViableAltException nvae = new NoViableAltException("", 1, 0, input);
|
|
DebugRecognitionException(nvae);
|
|
throw nvae;
|
|
}
|
|
} finally { DebugExitDecision(1); }
|
|
switch (alt1)
|
|
{
|
|
case 1:
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:180:4: '12' '0' .. '7'
|
|
{
|
|
DebugLocation(180, 4);
|
|
Match("12");
|
|
|
|
DebugLocation(180, 9);
|
|
MatchRange('0','7');
|
|
|
|
}
|
|
break;
|
|
case 2:
|
|
DebugEnterAlt(2);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:181:4: '1' '0' .. '1' '0' .. '9'
|
|
{
|
|
DebugLocation(181, 4);
|
|
Match('1');
|
|
DebugLocation(181, 8);
|
|
MatchRange('0','1');
|
|
DebugLocation(181, 17);
|
|
MatchRange('0','9');
|
|
|
|
}
|
|
break;
|
|
case 3:
|
|
DebugEnterAlt(3);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:182:4: '0' '0' .. '9' '0' .. '9'
|
|
{
|
|
DebugLocation(182, 4);
|
|
Match('0');
|
|
DebugLocation(182, 8);
|
|
MatchRange('0','9');
|
|
DebugLocation(182, 17);
|
|
MatchRange('0','9');
|
|
|
|
}
|
|
break;
|
|
|
|
}
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("ASCII_ESC", 48);
|
|
LeaveRule("ASCII_ESC", 48);
|
|
LeaveRule_ASCII_ESC();
|
|
}
|
|
}
|
|
// $ANTLR end "ASCII_ESC"
|
|
|
|
partial void EnterRule_INT();
|
|
partial void LeaveRule_INT();
|
|
|
|
// $ANTLR start "INT"
|
|
[GrammarRule("INT")]
|
|
private void mINT()
|
|
{
|
|
EnterRule_INT();
|
|
EnterRule("INT", 49);
|
|
TraceIn("INT", 49);
|
|
try
|
|
{
|
|
int _type = INT;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:185:2: ( ( DIGIT )+ )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:185:4: ( DIGIT )+
|
|
{
|
|
DebugLocation(185, 4);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:185:4: ( DIGIT )+
|
|
int cnt2=0;
|
|
try { DebugEnterSubRule(2);
|
|
while (true)
|
|
{
|
|
int alt2=2;
|
|
try { DebugEnterDecision(2, false);
|
|
int LA2_0 = input.LA(1);
|
|
|
|
if (((LA2_0>='0' && LA2_0<='9')))
|
|
{
|
|
alt2 = 1;
|
|
}
|
|
|
|
|
|
} finally { DebugExitDecision(2); }
|
|
switch (alt2)
|
|
{
|
|
case 1:
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:
|
|
{
|
|
DebugLocation(185, 4);
|
|
input.Consume();
|
|
|
|
|
|
}
|
|
break;
|
|
|
|
default:
|
|
if (cnt2 >= 1)
|
|
goto loop2;
|
|
|
|
EarlyExitException eee2 = new EarlyExitException( 2, input );
|
|
DebugRecognitionException(eee2);
|
|
throw eee2;
|
|
}
|
|
cnt2++;
|
|
}
|
|
loop2:
|
|
;
|
|
|
|
} finally { DebugExitSubRule(2); }
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("INT", 49);
|
|
LeaveRule("INT", 49);
|
|
LeaveRule_INT();
|
|
}
|
|
}
|
|
// $ANTLR end "INT"
|
|
|
|
partial void EnterRule_ID();
|
|
partial void LeaveRule_ID();
|
|
|
|
// $ANTLR start "ID"
|
|
[GrammarRule("ID")]
|
|
private void mID()
|
|
{
|
|
EnterRule_ID();
|
|
EnterRule("ID", 50);
|
|
TraceIn("ID", 50);
|
|
try
|
|
{
|
|
int _type = ID;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:188:5: ( LETTER ( LETTER | DIGIT | '_' )* )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:188:7: LETTER ( LETTER | DIGIT | '_' )*
|
|
{
|
|
DebugLocation(188, 7);
|
|
mLETTER();
|
|
DebugLocation(188, 14);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:188:14: ( LETTER | DIGIT | '_' )*
|
|
try { DebugEnterSubRule(3);
|
|
while (true)
|
|
{
|
|
int alt3=2;
|
|
try { DebugEnterDecision(3, false);
|
|
int LA3_0 = input.LA(1);
|
|
|
|
if (((LA3_0>='0' && LA3_0<='9')||(LA3_0>='A' && LA3_0<='Z')||LA3_0=='_'||(LA3_0>='a' && LA3_0<='z')))
|
|
{
|
|
alt3 = 1;
|
|
}
|
|
|
|
|
|
} finally { DebugExitDecision(3); }
|
|
switch ( alt3 )
|
|
{
|
|
case 1:
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:
|
|
{
|
|
DebugLocation(188, 14);
|
|
input.Consume();
|
|
|
|
|
|
}
|
|
break;
|
|
|
|
default:
|
|
goto loop3;
|
|
}
|
|
}
|
|
|
|
loop3:
|
|
;
|
|
|
|
} finally { DebugExitSubRule(3); }
|
|
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("ID", 50);
|
|
LeaveRule("ID", 50);
|
|
LeaveRule_ID();
|
|
}
|
|
}
|
|
// $ANTLR end "ID"
|
|
|
|
partial void EnterRule_WS();
|
|
partial void LeaveRule_WS();
|
|
|
|
// $ANTLR start "WS"
|
|
[GrammarRule("WS")]
|
|
private void mWS()
|
|
{
|
|
EnterRule_WS();
|
|
EnterRule("WS", 51);
|
|
TraceIn("WS", 51);
|
|
try
|
|
{
|
|
int _type = WS;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:192:2: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:192:4: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
|
{
|
|
DebugLocation(192, 4);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:192:4: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
|
int cnt4=0;
|
|
try { DebugEnterSubRule(4);
|
|
while (true)
|
|
{
|
|
int alt4=2;
|
|
try { DebugEnterDecision(4, false);
|
|
int LA4_0 = input.LA(1);
|
|
|
|
if (((LA4_0>='\t' && LA4_0<='\n')||LA4_0=='\r'||LA4_0==' '))
|
|
{
|
|
alt4 = 1;
|
|
}
|
|
|
|
|
|
} finally { DebugExitDecision(4); }
|
|
switch (alt4)
|
|
{
|
|
case 1:
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:
|
|
{
|
|
DebugLocation(192, 4);
|
|
input.Consume();
|
|
|
|
|
|
}
|
|
break;
|
|
|
|
default:
|
|
if (cnt4 >= 1)
|
|
goto loop4;
|
|
|
|
EarlyExitException eee4 = new EarlyExitException( 4, input );
|
|
DebugRecognitionException(eee4);
|
|
throw eee4;
|
|
}
|
|
cnt4++;
|
|
}
|
|
loop4:
|
|
;
|
|
|
|
} finally { DebugExitSubRule(4); }
|
|
|
|
DebugLocation(193, 2);
|
|
_channel = Hidden;
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("WS", 51);
|
|
LeaveRule("WS", 51);
|
|
LeaveRule_WS();
|
|
}
|
|
}
|
|
// $ANTLR end "WS"
|
|
|
|
partial void EnterRule_ESC_SEQ();
|
|
partial void LeaveRule_ESC_SEQ();
|
|
|
|
// $ANTLR start "ESC_SEQ"
|
|
[GrammarRule("ESC_SEQ")]
|
|
private void mESC_SEQ()
|
|
{
|
|
EnterRule_ESC_SEQ();
|
|
EnterRule("ESC_SEQ", 52);
|
|
TraceIn("ESC_SEQ", 52);
|
|
try
|
|
{
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:200:2: ( '\\\\' ( 'n' | 'r' | 't' | QUOTE | ASCII_ESC | WS '\\\\' ) )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:200:4: '\\\\' ( 'n' | 'r' | 't' | QUOTE | ASCII_ESC | WS '\\\\' )
|
|
{
|
|
DebugLocation(200, 4);
|
|
Match('\\');
|
|
DebugLocation(200, 9);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:200:9: ( 'n' | 'r' | 't' | QUOTE | ASCII_ESC | WS '\\\\' )
|
|
int alt5=6;
|
|
try { DebugEnterSubRule(5);
|
|
try { DebugEnterDecision(5, false);
|
|
switch (input.LA(1))
|
|
{
|
|
case 'n':
|
|
{
|
|
alt5 = 1;
|
|
}
|
|
break;
|
|
case 'r':
|
|
{
|
|
alt5 = 2;
|
|
}
|
|
break;
|
|
case 't':
|
|
{
|
|
alt5 = 3;
|
|
}
|
|
break;
|
|
case '\"':
|
|
{
|
|
alt5 = 4;
|
|
}
|
|
break;
|
|
case '0':
|
|
case '1':
|
|
{
|
|
alt5 = 5;
|
|
}
|
|
break;
|
|
case '\t':
|
|
case '\n':
|
|
case '\r':
|
|
case ' ':
|
|
{
|
|
alt5 = 6;
|
|
}
|
|
break;
|
|
default:
|
|
{
|
|
NoViableAltException nvae = new NoViableAltException("", 5, 0, input);
|
|
DebugRecognitionException(nvae);
|
|
throw nvae;
|
|
}
|
|
}
|
|
|
|
} finally { DebugExitDecision(5); }
|
|
switch (alt5)
|
|
{
|
|
case 1:
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:200:11: 'n'
|
|
{
|
|
DebugLocation(200, 11);
|
|
Match('n');
|
|
|
|
}
|
|
break;
|
|
case 2:
|
|
DebugEnterAlt(2);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:200:17: 'r'
|
|
{
|
|
DebugLocation(200, 17);
|
|
Match('r');
|
|
|
|
}
|
|
break;
|
|
case 3:
|
|
DebugEnterAlt(3);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:200:23: 't'
|
|
{
|
|
DebugLocation(200, 23);
|
|
Match('t');
|
|
|
|
}
|
|
break;
|
|
case 4:
|
|
DebugEnterAlt(4);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:200:29: QUOTE
|
|
{
|
|
DebugLocation(200, 29);
|
|
mQUOTE();
|
|
|
|
}
|
|
break;
|
|
case 5:
|
|
DebugEnterAlt(5);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:200:37: ASCII_ESC
|
|
{
|
|
DebugLocation(200, 37);
|
|
mASCII_ESC();
|
|
|
|
}
|
|
break;
|
|
case 6:
|
|
DebugEnterAlt(6);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:200:49: WS '\\\\'
|
|
{
|
|
DebugLocation(200, 49);
|
|
mWS();
|
|
DebugLocation(200, 52);
|
|
Match('\\');
|
|
|
|
}
|
|
break;
|
|
|
|
}
|
|
} finally { DebugExitSubRule(5); }
|
|
|
|
|
|
}
|
|
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("ESC_SEQ", 52);
|
|
LeaveRule("ESC_SEQ", 52);
|
|
LeaveRule_ESC_SEQ();
|
|
}
|
|
}
|
|
// $ANTLR end "ESC_SEQ"
|
|
|
|
partial void EnterRule_PRINTABLE_CHARACTER();
|
|
partial void LeaveRule_PRINTABLE_CHARACTER();
|
|
|
|
// $ANTLR start "PRINTABLE_CHARACTER"
|
|
[GrammarRule("PRINTABLE_CHARACTER")]
|
|
private void mPRINTABLE_CHARACTER()
|
|
{
|
|
EnterRule_PRINTABLE_CHARACTER();
|
|
EnterRule("PRINTABLE_CHARACTER", 53);
|
|
TraceIn("PRINTABLE_CHARACTER", 53);
|
|
try
|
|
{
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:205:2: ( ( ( ' ' .. '!' ) | ( '#' .. '[' ) | ( ']' .. '~' ) ) )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:
|
|
{
|
|
DebugLocation(205, 2);
|
|
if ((input.LA(1)>=' ' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='~'))
|
|
{
|
|
input.Consume();
|
|
}
|
|
else
|
|
{
|
|
MismatchedSetException mse = new MismatchedSetException(null,input);
|
|
DebugRecognitionException(mse);
|
|
Recover(mse);
|
|
throw mse;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("PRINTABLE_CHARACTER", 53);
|
|
LeaveRule("PRINTABLE_CHARACTER", 53);
|
|
LeaveRule_PRINTABLE_CHARACTER();
|
|
}
|
|
}
|
|
// $ANTLR end "PRINTABLE_CHARACTER"
|
|
|
|
partial void EnterRule_STRING();
|
|
partial void LeaveRule_STRING();
|
|
|
|
// $ANTLR start "STRING"
|
|
[GrammarRule("STRING")]
|
|
private void mSTRING()
|
|
{
|
|
EnterRule_STRING();
|
|
EnterRule("STRING", 54);
|
|
TraceIn("STRING", 54);
|
|
try
|
|
{
|
|
int _type = STRING;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:207:8: ( QUOTE ( ESC_SEQ | PRINTABLE_CHARACTER )* QUOTE )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:207:10: QUOTE ( ESC_SEQ | PRINTABLE_CHARACTER )* QUOTE
|
|
{
|
|
DebugLocation(207, 10);
|
|
mQUOTE();
|
|
DebugLocation(207, 16);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:207:16: ( ESC_SEQ | PRINTABLE_CHARACTER )*
|
|
try { DebugEnterSubRule(6);
|
|
while (true)
|
|
{
|
|
int alt6=3;
|
|
try { DebugEnterDecision(6, false);
|
|
int LA6_0 = input.LA(1);
|
|
|
|
if ((LA6_0=='\\'))
|
|
{
|
|
alt6 = 1;
|
|
}
|
|
else if (((LA6_0>=' ' && LA6_0<='!')||(LA6_0>='#' && LA6_0<='[')||(LA6_0>=']' && LA6_0<='~')))
|
|
{
|
|
alt6 = 2;
|
|
}
|
|
|
|
|
|
} finally { DebugExitDecision(6); }
|
|
switch ( alt6 )
|
|
{
|
|
case 1:
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:207:18: ESC_SEQ
|
|
{
|
|
DebugLocation(207, 18);
|
|
mESC_SEQ();
|
|
|
|
}
|
|
break;
|
|
case 2:
|
|
DebugEnterAlt(2);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:207:28: PRINTABLE_CHARACTER
|
|
{
|
|
DebugLocation(207, 28);
|
|
mPRINTABLE_CHARACTER();
|
|
|
|
}
|
|
break;
|
|
|
|
default:
|
|
goto loop6;
|
|
}
|
|
}
|
|
|
|
loop6:
|
|
;
|
|
|
|
} finally { DebugExitSubRule(6); }
|
|
|
|
DebugLocation(207, 51);
|
|
mQUOTE();
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("STRING", 54);
|
|
LeaveRule("STRING", 54);
|
|
LeaveRule_STRING();
|
|
}
|
|
}
|
|
// $ANTLR end "STRING"
|
|
|
|
partial void EnterRule_COMMENTARY();
|
|
partial void LeaveRule_COMMENTARY();
|
|
|
|
// $ANTLR start "COMMENTARY"
|
|
[GrammarRule("COMMENTARY")]
|
|
private void mCOMMENTARY()
|
|
{
|
|
EnterRule_COMMENTARY();
|
|
EnterRule("COMMENTARY", 55);
|
|
TraceIn("COMMENTARY", 55);
|
|
try
|
|
{
|
|
int _type = COMMENTARY;
|
|
int _channel = DefaultTokenChannel;
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:210:2: ( BEGIN_COMMENT ( options {greedy=false; } : . )* ( COMMENTARY ( options {greedy=false; } : . )* )* END_COMMENT )
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:210:4: BEGIN_COMMENT ( options {greedy=false; } : . )* ( COMMENTARY ( options {greedy=false; } : . )* )* END_COMMENT
|
|
{
|
|
DebugLocation(210, 4);
|
|
mBEGIN_COMMENT();
|
|
DebugLocation(211, 7);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:211:7: ( options {greedy=false; } : . )*
|
|
try { DebugEnterSubRule(7);
|
|
while (true)
|
|
{
|
|
int alt7=2;
|
|
try { DebugEnterDecision(7, false);
|
|
int LA7_0 = input.LA(1);
|
|
|
|
if ((LA7_0=='/'))
|
|
{
|
|
int LA7_1 = input.LA(2);
|
|
|
|
if ((LA7_1=='*'))
|
|
{
|
|
alt7 = 2;
|
|
}
|
|
else if (((LA7_1>='\u0000' && LA7_1<=')')||(LA7_1>='+' && LA7_1<='\uFFFF')))
|
|
{
|
|
alt7 = 1;
|
|
}
|
|
|
|
|
|
}
|
|
else if ((LA7_0=='*'))
|
|
{
|
|
int LA7_2 = input.LA(2);
|
|
|
|
if ((LA7_2=='/'))
|
|
{
|
|
alt7 = 2;
|
|
}
|
|
else if (((LA7_2>='\u0000' && LA7_2<='.')||(LA7_2>='0' && LA7_2<='\uFFFF')))
|
|
{
|
|
alt7 = 1;
|
|
}
|
|
|
|
|
|
}
|
|
else if (((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='.')||(LA7_0>='0' && LA7_0<='\uFFFF')))
|
|
{
|
|
alt7 = 1;
|
|
}
|
|
|
|
|
|
} finally { DebugExitDecision(7); }
|
|
switch ( alt7 )
|
|
{
|
|
case 1:
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:211:35: .
|
|
{
|
|
DebugLocation(211, 35);
|
|
MatchAny();
|
|
|
|
}
|
|
break;
|
|
|
|
default:
|
|
goto loop7;
|
|
}
|
|
}
|
|
|
|
loop7:
|
|
;
|
|
|
|
} finally { DebugExitSubRule(7); }
|
|
|
|
DebugLocation(212, 7);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:212:7: ( COMMENTARY ( options {greedy=false; } : . )* )*
|
|
try { DebugEnterSubRule(9);
|
|
while (true)
|
|
{
|
|
int alt9=2;
|
|
try { DebugEnterDecision(9, false);
|
|
int LA9_0 = input.LA(1);
|
|
|
|
if ((LA9_0=='/'))
|
|
{
|
|
alt9 = 1;
|
|
}
|
|
|
|
|
|
} finally { DebugExitDecision(9); }
|
|
switch ( alt9 )
|
|
{
|
|
case 1:
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:212:10: COMMENTARY ( options {greedy=false; } : . )*
|
|
{
|
|
DebugLocation(212, 10);
|
|
mCOMMENTARY();
|
|
DebugLocation(212, 21);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:212:21: ( options {greedy=false; } : . )*
|
|
try { DebugEnterSubRule(8);
|
|
while (true)
|
|
{
|
|
int alt8=2;
|
|
try { DebugEnterDecision(8, false);
|
|
int LA8_0 = input.LA(1);
|
|
|
|
if ((LA8_0=='*'))
|
|
{
|
|
int LA8_1 = input.LA(2);
|
|
|
|
if ((LA8_1=='/'))
|
|
{
|
|
alt8 = 2;
|
|
}
|
|
else if (((LA8_1>='\u0000' && LA8_1<='.')||(LA8_1>='0' && LA8_1<='\uFFFF')))
|
|
{
|
|
alt8 = 1;
|
|
}
|
|
|
|
|
|
}
|
|
else if ((LA8_0=='/'))
|
|
{
|
|
int LA8_2 = input.LA(2);
|
|
|
|
if ((LA8_2=='*'))
|
|
{
|
|
alt8 = 2;
|
|
}
|
|
else if (((LA8_2>='\u0000' && LA8_2<=')')||(LA8_2>='+' && LA8_2<='\uFFFF')))
|
|
{
|
|
alt8 = 1;
|
|
}
|
|
|
|
|
|
}
|
|
else if (((LA8_0>='\u0000' && LA8_0<=')')||(LA8_0>='+' && LA8_0<='.')||(LA8_0>='0' && LA8_0<='\uFFFF')))
|
|
{
|
|
alt8 = 1;
|
|
}
|
|
|
|
|
|
} finally { DebugExitDecision(8); }
|
|
switch ( alt8 )
|
|
{
|
|
case 1:
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:212:49: .
|
|
{
|
|
DebugLocation(212, 49);
|
|
MatchAny();
|
|
|
|
}
|
|
break;
|
|
|
|
default:
|
|
goto loop8;
|
|
}
|
|
}
|
|
|
|
loop8:
|
|
;
|
|
|
|
} finally { DebugExitSubRule(8); }
|
|
|
|
|
|
}
|
|
break;
|
|
|
|
default:
|
|
goto loop9;
|
|
}
|
|
}
|
|
|
|
loop9:
|
|
;
|
|
|
|
} finally { DebugExitSubRule(9); }
|
|
|
|
DebugLocation(213, 6);
|
|
mEND_COMMENT();
|
|
DebugLocation(214, 4);
|
|
_channel = Hidden;
|
|
|
|
}
|
|
|
|
state.type = _type;
|
|
state.channel = _channel;
|
|
}
|
|
finally
|
|
{
|
|
TraceOut("COMMENTARY", 55);
|
|
LeaveRule("COMMENTARY", 55);
|
|
LeaveRule_COMMENTARY();
|
|
}
|
|
}
|
|
// $ANTLR end "COMMENTARY"
|
|
|
|
public override void mTokens()
|
|
{
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:8: ( PLUS | MINUS | MULT | DIV | EQ | NOTEQ | GT | GTEQ | LT | LTEQ | AND | OR | LPAREN | RPAREN | LBRACKET | RBRACKET | LKEY | RKEY | COMMA | SEMI | COLON | DOT | ASSIGN | ARRAYKEY | BREAKKEY | DOKEY | ELSEKEY | ENDKEY | FORKEY | FUNCTIONKEY | IFKEY | INKEY | INTKEY | LETKEY | NILKEY | OFKEY | STRINGKEY | THENKEY | TOKEY | TYPEKEY | VARKEY | WHILEKEY | INT | ID | WS | STRING | COMMENTARY )
|
|
int alt10=47;
|
|
try { DebugEnterDecision(10, false);
|
|
try
|
|
{
|
|
alt10 = dfa10.Predict(input);
|
|
}
|
|
catch (NoViableAltException nvae)
|
|
{
|
|
DebugRecognitionException(nvae);
|
|
throw;
|
|
}
|
|
} finally { DebugExitDecision(10); }
|
|
switch (alt10)
|
|
{
|
|
case 1:
|
|
DebugEnterAlt(1);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:10: PLUS
|
|
{
|
|
DebugLocation(1, 10);
|
|
mPLUS();
|
|
|
|
}
|
|
break;
|
|
case 2:
|
|
DebugEnterAlt(2);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:15: MINUS
|
|
{
|
|
DebugLocation(1, 15);
|
|
mMINUS();
|
|
|
|
}
|
|
break;
|
|
case 3:
|
|
DebugEnterAlt(3);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:21: MULT
|
|
{
|
|
DebugLocation(1, 21);
|
|
mMULT();
|
|
|
|
}
|
|
break;
|
|
case 4:
|
|
DebugEnterAlt(4);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:26: DIV
|
|
{
|
|
DebugLocation(1, 26);
|
|
mDIV();
|
|
|
|
}
|
|
break;
|
|
case 5:
|
|
DebugEnterAlt(5);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:30: EQ
|
|
{
|
|
DebugLocation(1, 30);
|
|
mEQ();
|
|
|
|
}
|
|
break;
|
|
case 6:
|
|
DebugEnterAlt(6);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:33: NOTEQ
|
|
{
|
|
DebugLocation(1, 33);
|
|
mNOTEQ();
|
|
|
|
}
|
|
break;
|
|
case 7:
|
|
DebugEnterAlt(7);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:39: GT
|
|
{
|
|
DebugLocation(1, 39);
|
|
mGT();
|
|
|
|
}
|
|
break;
|
|
case 8:
|
|
DebugEnterAlt(8);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:42: GTEQ
|
|
{
|
|
DebugLocation(1, 42);
|
|
mGTEQ();
|
|
|
|
}
|
|
break;
|
|
case 9:
|
|
DebugEnterAlt(9);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:47: LT
|
|
{
|
|
DebugLocation(1, 47);
|
|
mLT();
|
|
|
|
}
|
|
break;
|
|
case 10:
|
|
DebugEnterAlt(10);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:50: LTEQ
|
|
{
|
|
DebugLocation(1, 50);
|
|
mLTEQ();
|
|
|
|
}
|
|
break;
|
|
case 11:
|
|
DebugEnterAlt(11);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:55: AND
|
|
{
|
|
DebugLocation(1, 55);
|
|
mAND();
|
|
|
|
}
|
|
break;
|
|
case 12:
|
|
DebugEnterAlt(12);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:59: OR
|
|
{
|
|
DebugLocation(1, 59);
|
|
mOR();
|
|
|
|
}
|
|
break;
|
|
case 13:
|
|
DebugEnterAlt(13);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:62: LPAREN
|
|
{
|
|
DebugLocation(1, 62);
|
|
mLPAREN();
|
|
|
|
}
|
|
break;
|
|
case 14:
|
|
DebugEnterAlt(14);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:69: RPAREN
|
|
{
|
|
DebugLocation(1, 69);
|
|
mRPAREN();
|
|
|
|
}
|
|
break;
|
|
case 15:
|
|
DebugEnterAlt(15);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:76: LBRACKET
|
|
{
|
|
DebugLocation(1, 76);
|
|
mLBRACKET();
|
|
|
|
}
|
|
break;
|
|
case 16:
|
|
DebugEnterAlt(16);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:85: RBRACKET
|
|
{
|
|
DebugLocation(1, 85);
|
|
mRBRACKET();
|
|
|
|
}
|
|
break;
|
|
case 17:
|
|
DebugEnterAlt(17);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:94: LKEY
|
|
{
|
|
DebugLocation(1, 94);
|
|
mLKEY();
|
|
|
|
}
|
|
break;
|
|
case 18:
|
|
DebugEnterAlt(18);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:99: RKEY
|
|
{
|
|
DebugLocation(1, 99);
|
|
mRKEY();
|
|
|
|
}
|
|
break;
|
|
case 19:
|
|
DebugEnterAlt(19);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:104: COMMA
|
|
{
|
|
DebugLocation(1, 104);
|
|
mCOMMA();
|
|
|
|
}
|
|
break;
|
|
case 20:
|
|
DebugEnterAlt(20);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:110: SEMI
|
|
{
|
|
DebugLocation(1, 110);
|
|
mSEMI();
|
|
|
|
}
|
|
break;
|
|
case 21:
|
|
DebugEnterAlt(21);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:115: COLON
|
|
{
|
|
DebugLocation(1, 115);
|
|
mCOLON();
|
|
|
|
}
|
|
break;
|
|
case 22:
|
|
DebugEnterAlt(22);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:121: DOT
|
|
{
|
|
DebugLocation(1, 121);
|
|
mDOT();
|
|
|
|
}
|
|
break;
|
|
case 23:
|
|
DebugEnterAlt(23);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:125: ASSIGN
|
|
{
|
|
DebugLocation(1, 125);
|
|
mASSIGN();
|
|
|
|
}
|
|
break;
|
|
case 24:
|
|
DebugEnterAlt(24);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:132: ARRAYKEY
|
|
{
|
|
DebugLocation(1, 132);
|
|
mARRAYKEY();
|
|
|
|
}
|
|
break;
|
|
case 25:
|
|
DebugEnterAlt(25);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:141: BREAKKEY
|
|
{
|
|
DebugLocation(1, 141);
|
|
mBREAKKEY();
|
|
|
|
}
|
|
break;
|
|
case 26:
|
|
DebugEnterAlt(26);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:150: DOKEY
|
|
{
|
|
DebugLocation(1, 150);
|
|
mDOKEY();
|
|
|
|
}
|
|
break;
|
|
case 27:
|
|
DebugEnterAlt(27);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:156: ELSEKEY
|
|
{
|
|
DebugLocation(1, 156);
|
|
mELSEKEY();
|
|
|
|
}
|
|
break;
|
|
case 28:
|
|
DebugEnterAlt(28);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:164: ENDKEY
|
|
{
|
|
DebugLocation(1, 164);
|
|
mENDKEY();
|
|
|
|
}
|
|
break;
|
|
case 29:
|
|
DebugEnterAlt(29);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:171: FORKEY
|
|
{
|
|
DebugLocation(1, 171);
|
|
mFORKEY();
|
|
|
|
}
|
|
break;
|
|
case 30:
|
|
DebugEnterAlt(30);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:178: FUNCTIONKEY
|
|
{
|
|
DebugLocation(1, 178);
|
|
mFUNCTIONKEY();
|
|
|
|
}
|
|
break;
|
|
case 31:
|
|
DebugEnterAlt(31);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:190: IFKEY
|
|
{
|
|
DebugLocation(1, 190);
|
|
mIFKEY();
|
|
|
|
}
|
|
break;
|
|
case 32:
|
|
DebugEnterAlt(32);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:196: INKEY
|
|
{
|
|
DebugLocation(1, 196);
|
|
mINKEY();
|
|
|
|
}
|
|
break;
|
|
case 33:
|
|
DebugEnterAlt(33);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:202: INTKEY
|
|
{
|
|
DebugLocation(1, 202);
|
|
mINTKEY();
|
|
|
|
}
|
|
break;
|
|
case 34:
|
|
DebugEnterAlt(34);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:209: LETKEY
|
|
{
|
|
DebugLocation(1, 209);
|
|
mLETKEY();
|
|
|
|
}
|
|
break;
|
|
case 35:
|
|
DebugEnterAlt(35);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:216: NILKEY
|
|
{
|
|
DebugLocation(1, 216);
|
|
mNILKEY();
|
|
|
|
}
|
|
break;
|
|
case 36:
|
|
DebugEnterAlt(36);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:223: OFKEY
|
|
{
|
|
DebugLocation(1, 223);
|
|
mOFKEY();
|
|
|
|
}
|
|
break;
|
|
case 37:
|
|
DebugEnterAlt(37);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:229: STRINGKEY
|
|
{
|
|
DebugLocation(1, 229);
|
|
mSTRINGKEY();
|
|
|
|
}
|
|
break;
|
|
case 38:
|
|
DebugEnterAlt(38);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:239: THENKEY
|
|
{
|
|
DebugLocation(1, 239);
|
|
mTHENKEY();
|
|
|
|
}
|
|
break;
|
|
case 39:
|
|
DebugEnterAlt(39);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:247: TOKEY
|
|
{
|
|
DebugLocation(1, 247);
|
|
mTOKEY();
|
|
|
|
}
|
|
break;
|
|
case 40:
|
|
DebugEnterAlt(40);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:253: TYPEKEY
|
|
{
|
|
DebugLocation(1, 253);
|
|
mTYPEKEY();
|
|
|
|
}
|
|
break;
|
|
case 41:
|
|
DebugEnterAlt(41);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:261: VARKEY
|
|
{
|
|
DebugLocation(1, 261);
|
|
mVARKEY();
|
|
|
|
}
|
|
break;
|
|
case 42:
|
|
DebugEnterAlt(42);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:268: WHILEKEY
|
|
{
|
|
DebugLocation(1, 268);
|
|
mWHILEKEY();
|
|
|
|
}
|
|
break;
|
|
case 43:
|
|
DebugEnterAlt(43);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:277: INT
|
|
{
|
|
DebugLocation(1, 277);
|
|
mINT();
|
|
|
|
}
|
|
break;
|
|
case 44:
|
|
DebugEnterAlt(44);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:281: ID
|
|
{
|
|
DebugLocation(1, 281);
|
|
mID();
|
|
|
|
}
|
|
break;
|
|
case 45:
|
|
DebugEnterAlt(45);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:284: WS
|
|
{
|
|
DebugLocation(1, 284);
|
|
mWS();
|
|
|
|
}
|
|
break;
|
|
case 46:
|
|
DebugEnterAlt(46);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:287: STRING
|
|
{
|
|
DebugLocation(1, 287);
|
|
mSTRING();
|
|
|
|
}
|
|
break;
|
|
case 47:
|
|
DebugEnterAlt(47);
|
|
// D:\\~Compilador\\!yatc\\Grammar\\tiger.g:1:294: COMMENTARY
|
|
{
|
|
DebugLocation(1, 294);
|
|
mCOMMENTARY();
|
|
|
|
}
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
#region DFA
|
|
DFA10 dfa10;
|
|
|
|
protected override void InitDFAs()
|
|
{
|
|
base.InitDFAs();
|
|
dfa10 = new DFA10(this);
|
|
}
|
|
|
|
private class DFA10 : DFA
|
|
{
|
|
private const string DFA10_eotS =
|
|
"\x4\xFFFF\x1\x26\x1\xFFFF\x1\x29\x1\x2B\xA\xFFFF\x1\x2D\x1\xFFFF\xD\x22"+
|
|
"\xD\xFFFF\x2\x22\x1\x42\x4\x22\x1\x47\x1\x49\x2\x22\x1\x4C\x2\x22\x1"+
|
|
"\x4F\x5\x22\x1\xFFFF\x1\x22\x1\x56\x1\x57\x1\x22\x1\xFFFF\x1\x59\x1\xFFFF"+
|
|
"\x1\x5A\x1\x5B\x1\xFFFF\x2\x22\x1\xFFFF\x1\x22\x1\x5F\x3\x22\x1\x63\x2"+
|
|
"\xFFFF\x1\x22\x3\xFFFF\x1\x22\x1\x66\x1\x67\x1\xFFFF\x1\x22\x1\x69\x1"+
|
|
"\x6A\x1\xFFFF\x2\x22\x2\xFFFF\x1\x6D\x2\xFFFF\x1\x22\x1\x6F\x1\xFFFF"+
|
|
"\x1\x22\x1\xFFFF\x1\x71\x1\xFFFF";
|
|
private const string DFA10_eofS =
|
|
"\x72\xFFFF";
|
|
private const string DFA10_minS =
|
|
"\x1\x9\x3\xFFFF\x1\x2A\x1\xFFFF\x2\x3D\xA\xFFFF\x1\x3D\x1\xFFFF\x2\x72"+
|
|
"\x1\x6F\x1\x6C\x1\x6F\x1\x66\x1\x65\x1\x69\x1\x66\x1\x74\x1\x68\x1\x61"+
|
|
"\x1\x68\xD\xFFFF\x1\x72\x1\x65\x1\x30\x1\x73\x1\x64\x1\x72\x1\x6E\x2"+
|
|
"\x30\x1\x74\x1\x6C\x1\x30\x1\x72\x1\x65\x1\x30\x1\x70\x1\x72\x1\x69\x2"+
|
|
"\x61\x1\xFFFF\x1\x65\x2\x30\x1\x63\x1\xFFFF\x1\x30\x1\xFFFF\x2\x30\x1"+
|
|
"\xFFFF\x1\x69\x1\x6E\x1\xFFFF\x1\x65\x1\x30\x1\x6C\x1\x79\x1\x6B\x1\x30"+
|
|
"\x2\xFFFF\x1\x74\x3\xFFFF\x1\x6E\x2\x30\x1\xFFFF\x1\x65\x2\x30\x1\xFFFF"+
|
|
"\x1\x69\x1\x67\x2\xFFFF\x1\x30\x2\xFFFF\x1\x6F\x1\x30\x1\xFFFF\x1\x6E"+
|
|
"\x1\xFFFF\x1\x30\x1\xFFFF";
|
|
private const string DFA10_maxS =
|
|
"\x1\x7D\x3\xFFFF\x1\x2A\x1\xFFFF\x1\x3E\x1\x3D\xA\xFFFF\x1\x3D\x1\xFFFF"+
|
|
"\x2\x72\x1\x6F\x1\x6E\x1\x75\x1\x6E\x1\x65\x1\x69\x1\x66\x1\x74\x1\x79"+
|
|
"\x1\x61\x1\x68\xD\xFFFF\x1\x72\x1\x65\x1\x7A\x1\x73\x1\x64\x1\x72\x1"+
|
|
"\x6E\x2\x7A\x1\x74\x1\x6C\x1\x7A\x1\x72\x1\x65\x1\x7A\x1\x70\x1\x72\x1"+
|
|
"\x69\x2\x61\x1\xFFFF\x1\x65\x2\x7A\x1\x63\x1\xFFFF\x1\x7A\x1\xFFFF\x2"+
|
|
"\x7A\x1\xFFFF\x1\x69\x1\x6E\x1\xFFFF\x1\x65\x1\x7A\x1\x6C\x1\x79\x1\x6B"+
|
|
"\x1\x7A\x2\xFFFF\x1\x74\x3\xFFFF\x1\x6E\x2\x7A\x1\xFFFF\x1\x65\x2\x7A"+
|
|
"\x1\xFFFF\x1\x69\x1\x67\x2\xFFFF\x1\x7A\x2\xFFFF\x1\x6F\x1\x7A\x1\xFFFF"+
|
|
"\x1\x6E\x1\xFFFF\x1\x7A\x1\xFFFF";
|
|
private const string DFA10_acceptS =
|
|
"\x1\xFFFF\x1\x1\x1\x2\x1\x3\x1\xFFFF\x1\x5\x2\xFFFF\x1\xB\x1\xC\x1\xD"+
|
|
"\x1\xE\x1\xF\x1\x10\x1\x11\x1\x12\x1\x13\x1\x14\x1\xFFFF\x1\x16\xD\xFFFF"+
|
|
"\x1\x2B\x1\x2C\x1\x2D\x1\x2E\x1\x2F\x1\x4\x1\x6\x1\xA\x1\x9\x1\x8\x1"+
|
|
"\x7\x1\x17\x1\x15\x14\xFFFF\x1\x1A\x4\xFFFF\x1\x1F\x1\xFFFF\x1\x20\x2"+
|
|
"\xFFFF\x1\x24\x2\xFFFF\x1\x27\x6\xFFFF\x1\x1C\x1\x1D\x1\xFFFF\x1\x21"+
|
|
"\x1\x22\x1\x23\x3\xFFFF\x1\x29\x3\xFFFF\x1\x1B\x2\xFFFF\x1\x26\x1\x28"+
|
|
"\x1\xFFFF\x1\x18\x1\x19\x2\xFFFF\x1\x2A\x1\xFFFF\x1\x25\x1\xFFFF\x1\x1E";
|
|
private const string DFA10_specialS =
|
|
"\x72\xFFFF}>";
|
|
private static readonly string[] DFA10_transitionS =
|
|
{
|
|
"\x2\x23\x2\xFFFF\x1\x23\x12\xFFFF\x1\x23\x1\xFFFF\x1\x24\x3\xFFFF\x1"+
|
|
"\x8\x1\xFFFF\x1\xA\x1\xB\x1\x3\x1\x1\x1\x10\x1\x2\x1\x13\x1\x4\xA\x21"+
|
|
"\x1\x12\x1\x11\x1\x6\x1\x5\x1\x7\x2\xFFFF\x1A\x22\x1\xC\x1\xFFFF\x1"+
|
|
"\xD\x3\xFFFF\x1\x14\x1\x15\x1\x22\x1\x16\x1\x17\x1\x18\x2\x22\x1\x19"+
|
|
"\x2\x22\x1\x1A\x1\x22\x1\x1B\x1\x1C\x3\x22\x1\x1D\x1\x1E\x1\x22\x1\x1F"+
|
|
"\x1\x20\x3\x22\x1\xE\x1\x9\x1\xF",
|
|
"",
|
|
"",
|
|
"",
|
|
"\x1\x25",
|
|
"",
|
|
"\x1\x28\x1\x27",
|
|
"\x1\x2A",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"\x1\x2C",
|
|
"",
|
|
"\x1\x2E",
|
|
"\x1\x2F",
|
|
"\x1\x30",
|
|
"\x1\x31\x1\xFFFF\x1\x32",
|
|
"\x1\x33\x5\xFFFF\x1\x34",
|
|
"\x1\x35\x7\xFFFF\x1\x36",
|
|
"\x1\x37",
|
|
"\x1\x38",
|
|
"\x1\x39",
|
|
"\x1\x3A",
|
|
"\x1\x3B\x6\xFFFF\x1\x3C\x9\xFFFF\x1\x3D",
|
|
"\x1\x3E",
|
|
"\x1\x3F",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"",
|
|
"\x1\x40",
|
|
"\x1\x41",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"\x1\x43",
|
|
"\x1\x44",
|
|
"\x1\x45",
|
|
"\x1\x46",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x13\x22\x1\x48\x6"+
|
|
"\x22",
|
|
"\x1\x4A",
|
|
"\x1\x4B",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"\x1\x4D",
|
|
"\x1\x4E",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"\x1\x50",
|
|
"\x1\x51",
|
|
"\x1\x52",
|
|
"\x1\x53",
|
|
"\x1\x54",
|
|
"",
|
|
"\x1\x55",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"\x1\x58",
|
|
"",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"",
|
|
"\x1\x5C",
|
|
"\x1\x5D",
|
|
"",
|
|
"\x1\x5E",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"\x1\x60",
|
|
"\x1\x61",
|
|
"\x1\x62",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"",
|
|
"",
|
|
"\x1\x64",
|
|
"",
|
|
"",
|
|
"",
|
|
"\x1\x65",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"",
|
|
"\x1\x68",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"",
|
|
"\x1\x6B",
|
|
"\x1\x6C",
|
|
"",
|
|
"",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"",
|
|
"",
|
|
"\x1\x6E",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
"",
|
|
"\x1\x70",
|
|
"",
|
|
"\xA\x22\x7\xFFFF\x1A\x22\x4\xFFFF\x1\x22\x1\xFFFF\x1A\x22",
|
|
""
|
|
};
|
|
|
|
private static readonly short[] DFA10_eot = DFA.UnpackEncodedString(DFA10_eotS);
|
|
private static readonly short[] DFA10_eof = DFA.UnpackEncodedString(DFA10_eofS);
|
|
private static readonly char[] DFA10_min = DFA.UnpackEncodedStringToUnsignedChars(DFA10_minS);
|
|
private static readonly char[] DFA10_max = DFA.UnpackEncodedStringToUnsignedChars(DFA10_maxS);
|
|
private static readonly short[] DFA10_accept = DFA.UnpackEncodedString(DFA10_acceptS);
|
|
private static readonly short[] DFA10_special = DFA.UnpackEncodedString(DFA10_specialS);
|
|
private static readonly short[][] DFA10_transition;
|
|
|
|
static DFA10()
|
|
{
|
|
int numStates = DFA10_transitionS.Length;
|
|
DFA10_transition = new short[numStates][];
|
|
for ( int i=0; i < numStates; i++ )
|
|
{
|
|
DFA10_transition[i] = DFA.UnpackEncodedString(DFA10_transitionS[i]);
|
|
}
|
|
}
|
|
|
|
public DFA10( BaseRecognizer recognizer )
|
|
{
|
|
this.recognizer = recognizer;
|
|
this.decisionNumber = 10;
|
|
this.eot = DFA10_eot;
|
|
this.eof = DFA10_eof;
|
|
this.min = DFA10_min;
|
|
this.max = DFA10_max;
|
|
this.accept = DFA10_accept;
|
|
this.special = DFA10_special;
|
|
this.transition = DFA10_transition;
|
|
}
|
|
|
|
public override string Description { get { return "1:1: Tokens : ( PLUS | MINUS | MULT | DIV | EQ | NOTEQ | GT | GTEQ | LT | LTEQ | AND | OR | LPAREN | RPAREN | LBRACKET | RBRACKET | LKEY | RKEY | COMMA | SEMI | COLON | DOT | ASSIGN | ARRAYKEY | BREAKKEY | DOKEY | ELSEKEY | ENDKEY | FORKEY | FUNCTIONKEY | IFKEY | INKEY | INTKEY | LETKEY | NILKEY | OFKEY | STRINGKEY | THENKEY | TOKEY | TYPEKEY | VARKEY | WHILEKEY | INT | ID | WS | STRING | COMMENTARY );"; } }
|
|
|
|
public override void Error(NoViableAltException nvae)
|
|
{
|
|
DebugRecognitionException(nvae);
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
} // namespace YATC.Grammar
|