/* Generated By:JavaCC: Do not edit this line. TiraTeimaParser.java */
package tirateima.parser;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Point;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.Stack;
import tirateima.controlador.Controlador;
import tirateima.controlador.Command;
import tirateima.controlador.Operador;
import tirateima.controlador.CommandAttribution;
import tirateima.controlador.CommandJump;
import tirateima.controlador.CommandConditionalJump;
import tirateima.controlador.CommandNewType;
import tirateima.controlador.CommandNewVar;
import tirateima.controlador.CommandNewVarText;
import tirateima.controlador.CommandDirectPointer;
import tirateima.controlador.CommandReadInput;
import tirateima.controlador.FunctionDeclaration;
import tirateima.controlador.CommandStartFunction;
import tirateima.controlador.CommandEndFunction;
import tirateima.controlador.CommandOperationCall;
import tirateima.controlador.CommandInsertText;
import tirateima.controlador.CommandRemoveVar;
import tirateima.controlador.Index;
import tirateima.controlador.Step;
import tirateima.controlador.Type;
import tirateima.controlador.TypeId;
import tirateima.controlador.VarDefinition;
public class TiraTeimaParser implements TiraTeimaParserConstants {
/** Trata a string caractere a caractere, e troca as substrings de caracteres de escape
* por apenas um caractere de escape
* @param s A string a ser tratada
* @return Uma nova string com os caracteres que necessitam de tratamento já tratados
*/
private String tratarString(String s) {
char chars[] = s.toCharArray();
StringBuffer buffer = new StringBuffer();
//ignora as aspas
int lim = chars.length - 1;
for(int i = 1; i < lim; i++) {
if (chars[i] == '\u005c\u005c') {
switch (chars[++i]) {
case '\u005c\u005c':
buffer.append('\u005c\u005c');
break;
case 't':
buffer.append('\u005ct');
break;
case 'n':
buffer.append('\u005cn');
break;
case 'r':
buffer.append('\u005cr');
break;
case '"':
buffer.append('"');
break;
}
} else {
buffer.append(chars[i]);
}
}
return buffer.toString();
}
/** Trata uma string que seja um caractere, trocando as o valor por um caracteres de
* escape, se necessário
* @param s A string a ser tratada como um caractere
* @return Um novo caractere já tratado, caso tenha sido encontrado um literal
*/
private Character tratarChar(String s) {
char chars[] = s.toCharArray();
//ignora as aspas
char c = chars[1];
if (c == '\u005c\u005c') {
switch (chars[2]) {
case '\u005c\u005c':
c = '\u005c\u005c';
break;
case 't':
c = '\u005ct';
break;
case 'n':
c = '\u005cn';
break;
case 'r':
c = '\u005cr';
break;
case '\u005c'':
c = '\u005c'';
break;
}
}
return new Character(c);
}
/** Um passo é uma indicação de linha seguida de um comando com ou sem label:
* [line] <nro linha> [label] <comando>
*/
final public Step step() throws ParseException {
Token nroLinha;
Step p;
if (jj_2_3(3)) {
if (jj_2_1(3)) {
jj_consume_token(KW_LINE);
} else {
;
}
nroLinha = jj_consume_token(INT_NUMBER);
p = new Step(Integer.parseInt(nroLinha.image));
if (jj_2_2(3)) {
label(p);
} else {
;
}
command(p);
{if (true) return p;}
} else if (jj_2_4(3)) {
jj_consume_token(0);
{if (true) return null;}
} else {
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
/** Um comando é um dos comandos básicos ou é um bloco de comandos
* @param p Um Step
*/
final public void command(Step p) throws ParseException {
if (jj_2_5(3)) {
jj_consume_token(SEMICOLON);
} else if (jj_2_6(3)) {
cmd_new_type(p);
} else if (jj_2_7(3)) {
cmd_new_var(p);
} else if (jj_2_8(3)) {
cmd_atrib(p);
} else if (jj_2_9(3)) {
cmd_direct_pointer(p);
} else if (jj_2_10(3)) {
cmd_new_file(p);
} else if (jj_2_11(3)) {
cmd_jump(p);
} else if (jj_2_12(3)) {
cmd_conditional_jump(p);
} else if (jj_2_13(3)) {
cmd_read(p);
} else if (jj_2_14(3)) {
cmd_remove_var(p);
} else if (jj_2_15(3)) {
function_declaration(p);
} else if (jj_2_16(3)) {
function_start(p);
} else if (jj_2_17(3)) {
function_end(p);
} else if (jj_2_18(3)) {
operation_call(p);
} else if (jj_2_19(3)) {
cmd_insert_text(p);
} else if (jj_2_20(3)) {
bloco(p);
} else {
jj_consume_token(-1);
throw new ParseException();
}
}
/** Adiciona um label ao passo caso caso exista */
final public void label(Step p) throws ParseException {
Token label;
label = jj_consume_token(IDENTIFIER);
p.label = label.image;
jj_consume_token(COLON);
}
final public void cmd_read(Step p) throws ParseException {
Stack<Object> var_stack = new Stack<Object>();
jj_consume_token(KW_READ_FROM_USER);
jj_consume_token(OPEN_PAR);
variavel(var_stack);
jj_consume_token(CLOSE_PAR);
jj_consume_token(SEMICOLON);
p.addCommand(new CommandReadInput(var_stack));
}
/**
* Cria um comando de jump condicional e o coloca na lista de passos. Esse comando ativa
* a avaliação de expressões em tempo de execução do código de modo que ele executará o
* desvio se a expressão avaliada for verdadeira.
*/
final public void cmd_conditional_jump(Step p) throws ParseException {
Stack<Object> pilhaSimbolos = new Stack<Object>();
Token label;
jj_consume_token(KW_IF);
jj_consume_token(OPEN_PAR);
expression(pilhaSimbolos);
jj_consume_token(CLOSE_PAR);
jj_consume_token(KW_GOTO);
jj_consume_token(OPEN_PAR);
label = jj_consume_token(IDENTIFIER);
p.addCommand(new CommandConditionalJump(label.image,pilhaSimbolos));
jj_consume_token(CLOSE_PAR);
jj_consume_token(SEMICOLON);
}
/**
* Executa o parse de uma expressão. Coloca cada símbolo encontrado em uma
* pilha para ser computada em tempo de execução. Para tanto, foi utilizada
* uma gramática reduzida baseada na gramática do C, a qual encontra-se no
* arquivo C.jj deste projeto. Ele utiliza a mesma sintaxe, porém com menos
* possiblidades, o que poderá ser acrescentado de acordo com os requisitos
* da evolução do Tira-Teima.
*
* @param Stack<Object> pilha de símbolos para receber cada valor lido.
*/
final public void expression(Stack<Object> pilhaSimbolos) throws ParseException {
ConditionalExpression(pilhaSimbolos);
}
final public void UnaryExpression(Stack<Object> pilhaSimbolos) throws ParseException {
if (jj_2_21(3)) {
PrimaryExpression(pilhaSimbolos);
} else if (jj_2_22(3)) {
UnaryOperator(pilhaSimbolos);
UnaryExpression(pilhaSimbolos);
} else {
jj_consume_token(-1);
throw new ParseException();
}
}
final public void ConditionalExpression(Stack<Object> pilhaSimbolos) throws ParseException {
LogicalORExpression(pilhaSimbolos);
}
final public void UnaryOperator(Stack<Object> pilhaSimbolos) throws ParseException {
jj_consume_token(NOT_OP);
pilhaSimbolos.push(Operador.NOT_OP);
}
final public void PrimaryExpression(Stack<Object> pilhaSimbolos) throws ParseException {
Stack<Object> var_stack = new Stack<Object>();
Object constante;
if (jj_2_23(3)) {
variavel(var_stack);
pilhaSimbolos.push(var_stack);
} else if (jj_2_24(3)) {
constante = constant();
pilhaSimbolos.push(constante);
} else if (jj_2_25(3)) {
jj_consume_token(OPEN_PAR);
pilhaSimbolos.push(Operador.OPEN_PAR);
expression(pilhaSimbolos);
jj_consume_token(CLOSE_PAR);
pilhaSimbolos.push(Operador.CLOSE_PAR);
} else {
jj_consume_token(-1);
throw new ParseException();
}
}
final public void LogicalORExpression(Stack<Object> pilhaSimbolos) throws ParseException {
LogicalANDExpression(pilhaSimbolos);
if (jj_2_26(3)) {
jj_consume_token(OR_OP);
pilhaSimbolos.push(Operador.OR_OP);
LogicalORExpression(pilhaSimbolos);
} else {
;
}
}
final public void LogicalANDExpression(Stack<Object> pilhaSimbolos) throws ParseException {
EqualityExpression(pilhaSimbolos);
if (jj_2_27(3)) {
jj_consume_token(AND_OP);
pilhaSimbolos.push(Operador.AND_OP);
LogicalANDExpression(pilhaSimbolos);
} else {
;
}
}
final public void EqualityExpression(Stack<Object> pilhaSimbolos) throws ParseException {
RelationalExpression(pilhaSimbolos);
if (jj_2_30(3)) {
if (jj_2_28(3)) {
jj_consume_token(EQ_OP);
pilhaSimbolos.push(Operador.EQ_OP);
} else if (jj_2_29(3)) {
jj_consume_token(NE_OP);
pilhaSimbolos.push(Operador.NE_OP);
} else {
jj_consume_token(-1);
throw new ParseException();
}
EqualityExpression(pilhaSimbolos);
} else {
;
}
}
final public void RelationalExpression(Stack<Object> pilhaSimbolos) throws ParseException {
AdditiveExpression(pilhaSimbolos);
if (jj_2_35(3)) {
if (jj_2_31(3)) {
jj_consume_token(LT_OP);
pilhaSimbolos.push(Operador.LT_OP);
} else if (jj_2_32(3)) {
jj_consume_token(GT_OP);
pilhaSimbolos.push(Operador.GT_OP);
} else if (jj_2_33(3)) {
jj_consume_token(LE_OP);
pilhaSimbolos.push(Operador.LE_OP);
} else if (jj_2_34(3)) {
jj_consume_token(GE_OP);
pilhaSimbolos.push(Operador.GE_OP);
} else {
jj_consume_token(-1);
throw new ParseException();
}
RelationalExpression(pilhaSimbolos);
} else {
;
}
}
final public void AdditiveExpression(Stack<Object> pilhaSimbolos) throws ParseException {
MultiplicativeExpression(pilhaSimbolos);
if (jj_2_38(3)) {
if (jj_2_36(3)) {
jj_consume_token(ADD_OP);
pilhaSimbolos.push(Operador.ADD_OP);
} else if (jj_2_37(3)) {
jj_consume_token(SUB_OP);
pilhaSimbolos.push(Operador.SUB_OP);
} else {
jj_consume_token(-1);
throw new ParseException();
}
AdditiveExpression(pilhaSimbolos);
} else {
;
}
}
final public void MultiplicativeExpression(Stack<Object> pilhaSimbolos) throws ParseException {
UnaryExpression(pilhaSimbolos);
if (jj_2_42(3)) {
if (jj_2_39(3)) {
jj_consume_token(MULT_OP);
pilhaSimbolos.push(Operador.MULT_OP);
} else if (jj_2_40(3)) {
jj_consume_token(DIV_OP);
pilhaSimbolos.push(Operador.DIV_OP);
} else if (jj_2_41(3)) {
jj_consume_token(MOD_OP);
pilhaSimbolos.push(Operador.MOD_OP);
} else {
jj_consume_token(-1);
throw new ParseException();
}
MultiplicativeExpression(pilhaSimbolos);
} else {
;
}
}
/**
* Cria um comando de jump incondicional e o insere na lista de passos. O comando jump faz com que se vá
* para um estado que não necessáriamente é o próximo da lista. Procura-se, então, o passo
* que possui um determinado label associado e o fluxo de execução recomeça a partir dele.
*
* Essa estrutura se parece com os jumps do assembly ou com os goto de algumas linguagens.
*
* Esse jump pode ser de dois tipos:
* - JUMP CONDICIONAL: vai para o passo com um determinado label se uma condição for tida.
* - JUMP INCONDICIONAL: vai para o passo com um label determinado independente de qualquer
* condição.
*/
final public void cmd_jump(Step p) throws ParseException {
Token label;
jj_consume_token(KW_GOTO);
jj_consume_token(OPEN_PAR);
label = jj_consume_token(IDENTIFIER);
p.addCommand(new CommandJump(label.image));
jj_consume_token(CLOSE_PAR);
jj_consume_token(SEMICOLON);
}
/**
*Insere um texto de um determinado tamanho em uma dada posição
*/
final public void cmd_insert_text(Step p) throws ParseException {
String conteudo;
Point posicao;
Integer tamanho;
jj_consume_token(KW_INSERE_TEXTO);
conteudo = conteudo();
tamanho = font_size();
posicao = posicao();
jj_consume_token(SEMICOLON);
p.addCommand(new CommandInsertText(conteudo,tamanho,posicao));
}
/** Cria um novo tipo, criando uma lista com as variáveis que compõem este tipo
* @param p Um Step
*/
final public void cmd_new_type(Step p) throws ParseException {
Token t_name;
String name;
List<VarDefinition> aux, fields;
jj_consume_token(KW_RECORD);
fields = new ArrayList<VarDefinition>();
t_name = jj_consume_token(IDENTIFIER);
name = t_name.image;
jj_consume_token(OPEN_BRACE);
label_1:
while (true) {
aux = new_vars();
fields.addAll(aux);
if (jj_2_43(3)) {
;
} else {
break label_1;
}
}
jj_consume_token(CLOSE_BRACE);
p.addCommand(new CommandNewType(name, fields));
}
/** Gera um objeto list de VarDefinition's com as variáveis solicitadas
* @return Uma lista com as N variáveis solicitadas.
*/
final public List<VarDefinition> new_vars() throws ParseException {
Type type;
VarDefinition v;
List<VarDefinition> vars = new ArrayList<VarDefinition>();
type = type();
v = new_var(type);
vars.add(v);
label_2:
while (true) {
if (jj_2_44(3)) {
;
} else {
break label_2;
}
jj_consume_token(COMMA);
v = new_var(type);
vars.add(v);
}
jj_consume_token(SEMICOLON);
{if (true) return vars;}
throw new Error("Missing return statement in function");
}
/** Retorna um objeto com o tipo selecionado, com base na KW encontrada
* @return Um objeto com o tipo selecionado
*/
final public Type type() throws ParseException {
Token t;
if (jj_2_45(3)) {
t = jj_consume_token(KW_INT);
{if (true) return new Type(TypeId.INTEGER);}
} else if (jj_2_46(3)) {
t = jj_consume_token(KW_REAL);
{if (true) return new Type(TypeId.REAL);}
} else if (jj_2_47(3)) {
t = jj_consume_token(KW_CHAR);
{if (true) return new Type(TypeId.CHAR);}
} else if (jj_2_48(3)) {
t = jj_consume_token(KW_STRING);
{if (true) return new Type(TypeId.STRING);}
} else if (jj_2_49(3)) {
t = jj_consume_token(KW_BOOLEAN);
{if (true) return new Type(TypeId.BOOLEAN);}
} else if (jj_2_50(3)) {
t = jj_consume_token(KW_POINTER);
{if (true) return new Type(TypeId.POINTER);}
} else if (jj_2_51(3)) {
t = jj_consume_token(IDENTIFIER);
{if (true) return new Type(TypeId.RECORD, t.image);}
} else {
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
/** Gera apenas uma VarDefinition já configurando cor interna e externa, tamanho e posição
* @return Uma VarDefinition com a variável.
*/
final public VarDefinition new_var(Type type) throws ParseException {
Token t_name_var;
Index i = null;
Color color = null;
Color colorOutside = null;
Dimension dimension = null;
Point posicao = null;
boolean mostraNome = true;
t_name_var = jj_consume_token(IDENTIFIER);
if (jj_2_52(3)) {
i = index();
} else {
;
}
if (jj_2_53(3)) {
color = cor();
} else {
;
}
if (jj_2_54(3)) {
colorOutside = corExterna();
} else {
;
}
if (jj_2_55(3)) {
dimension = dimensao();
} else {
;
}
if (jj_2_56(3)) {
posicao = posicao();
} else {
;
}
if (jj_2_57(3)) {
mostraNome = mostraNome();
} else {
;
}
{if (true) return new VarDefinition(type, t_name_var.image, i, color, colorOutside, dimension, posicao, new Boolean(mostraNome));}
throw new Error("Missing return statement in function");
}
/** Cria e retorna um objeto de cor interna para a variável
* @return Um objeto Color com a cor da variável
*/
final public Color cor() throws ParseException {
Token t_value;
int r=0;
int g=0;
int b=0;
jj_consume_token(KW_COLOR);
jj_consume_token(OPEN_PAR);
t_value = jj_consume_token(INT_NUMBER);
r = Integer.parseInt(t_value.image);
jj_consume_token(COMMA);
t_value = jj_consume_token(INT_NUMBER);
g = Integer.parseInt(t_value.image);
jj_consume_token(COMMA);
t_value = jj_consume_token(INT_NUMBER);
b = Integer.parseInt(t_value.image);
jj_consume_token(CLOSE_PAR);
{if (true) return new Color(r,g,b);}
throw new Error("Missing return statement in function");
}
/** Cria e retorna um objeto de cor a ser utilizado para a cor externa da variável
* @return Um objeto Color com a cor externa da variável
*/
final public Color corExterna() throws ParseException {
Token t_value;
int r=0;
int g=0;
int b=0;
jj_consume_token(KW_COLOR_INSIDE);
jj_consume_token(OPEN_PAR);
t_value = jj_consume_token(INT_NUMBER);
r = Integer.parseInt(t_value.image);
jj_consume_token(COMMA);
t_value = jj_consume_token(INT_NUMBER);
g = Integer.parseInt(t_value.image);
jj_consume_token(COMMA);
t_value = jj_consume_token(INT_NUMBER);
b = Integer.parseInt(t_value.image);
jj_consume_token(CLOSE_PAR);
{if (true) return new Color(r,g,b);}
throw new Error("Missing return statement in function");
}
/** Retorna um objeto Dimension com os dados do tamanho da variável na GUI
* @return O objeto Dimension para formatar o tamanho da variável.
*/
final public Dimension dimensao() throws ParseException {
Token t_value;
int largura=0;
int altura=0;
jj_consume_token(KW_DIMENSION);
jj_consume_token(OPEN_PAR);
t_value = jj_consume_token(INT_NUMBER);
largura = Integer.parseInt(t_value.image);
jj_consume_token(COMMA);
t_value = jj_consume_token(INT_NUMBER);
altura = Integer.parseInt(t_value.image);
jj_consume_token(CLOSE_PAR);
{if (true) return new Dimension(largura,altura);}
throw new Error("Missing return statement in function");
}
/**
* Cria uma string a partir do texto passado no roteiro
*/
final public String conteudo() throws ParseException {
Token t_value;
jj_consume_token(KW_CONTEUDO);
jj_consume_token(OPEN_PAR);
t_value = jj_consume_token(STRING_LITERAL);
jj_consume_token(CLOSE_PAR);
{if (true) return t_value.image;}
throw new Error("Missing return statement in function");
}
/**
* Cria um Point para posicionar o objeto na GUI, com base nos valores passados.
* @return O objeto Point para ser utilizado no posicionamento da variável.
*/
final public Point posicao() throws ParseException {
Point coordenadas;
jj_consume_token(KW_POSITION);
coordenadas = coordenadas();
{if (true) return coordenadas;}
throw new Error("Missing return statement in function");
}
/**
* Verifica se um nome de uma variável vai ser mostrado ou não
*/
final public boolean mostraNome() throws ParseException {
boolean valorBooleano = true;
jj_consume_token(KW_SHOW_NAME);
jj_consume_token(OPEN_PAR);
if (jj_2_58(3)) {
jj_consume_token(KW_TRUE);
valorBooleano = true;
} else if (jj_2_59(3)) {
jj_consume_token(KW_FALSE);
valorBooleano = false;
} else {
jj_consume_token(-1);
throw new ParseException();
}
jj_consume_token(CLOSE_PAR);
{if (true) return valorBooleano;}
throw new Error("Missing return statement in function");
}
/**
* Cria um par de coordenadas x, y
*/
final public Point coordenadas() throws ParseException {
Token t_value;
int x=0;
int y=0;
jj_consume_token(OPEN_PAR);
t_value = jj_consume_token(INT_NUMBER);
x = Integer.parseInt(t_value.image);
jj_consume_token(COMMA);
t_value = jj_consume_token(INT_NUMBER);
y = Integer.parseInt(t_value.image);
jj_consume_token(CLOSE_PAR);
{if (true) return new Point(x,y);}
throw new Error("Missing return statement in function");
}
/**
* Cria um tamanho de fonte (size) para formatação
*/
final public Integer font_size() throws ParseException {
Integer tamanho;
jj_consume_token(KW_DIMENSION);
jj_consume_token(OPEN_PAR);
tamanho = size();
jj_consume_token(CLOSE_PAR);
{if (true) return tamanho;}
throw new Error("Missing return statement in function");
}
/** Cria e retorna um array ou matix.
* @return Retorna um objeto Index (do pacote Gerador)
*/
final public Index index() throws ParseException {
Token t_value;
Index result = new Index();
jj_consume_token(OPEN_BRACKET);
t_value = jj_consume_token(INT_NUMBER);
result.first = Integer.parseInt(t_value.image);
if (jj_2_60(3)) {
jj_consume_token(COMMA);
t_value = jj_consume_token(INT_NUMBER);
result.second = Integer.parseInt(t_value.image);
result.isMatrix = true;
} else {
;
}
jj_consume_token(CLOSE_BRACKET);
{if (true) return result;}
throw new Error("Missing return statement in function");
}
/** Chama a classe CommandNewVar para todas as variáveis instanciadas em um comando para um Step.
* @param Step atual sendo lido
*/
final public void cmd_new_var(Step p) throws ParseException {
List<VarDefinition> vars;
vars = new_vars();
ListIterator<VarDefinition> i = vars.listIterator();
while (i.hasNext()) {
p.addCommand(new CommandNewVar(i.next()));
}
}
/** Remove uma variável e suas setas do Tira-Teima.
* @param Step atual sendo lido
*/
final public void cmd_remove_var(Step p) throws ParseException {
Stack<Object> var_stack = new Stack<Object>();
jj_consume_token(KW_REMOVE_VAR);
jj_consume_token(OPEN_PAR);
variavel(var_stack);
p.addCommand(new CommandRemoveVar(var_stack));
jj_consume_token(CLOSE_PAR);
jj_consume_token(SEMICOLON);
}
/** Chama a classe atribuição para representação de atribuição de valor à uma variável
* @param Step
*/
final public void cmd_atrib(Step p) throws ParseException {
Stack<Object> var_stack = new Stack<Object>();
Stack<Object> pilhaSimbolos = new Stack<Object>();
variavel(var_stack);
jj_consume_token(ATTRIBUTION);
expression(pilhaSimbolos);
jj_consume_token(SEMICOLON);
p.addCommand(new CommandAttribution(var_stack, pilhaSimbolos));
}
/** Aponta o ponteiro para outra variavel, representando-se essa operacao por meio de uma seta de tamanho determinado
* apontada para uma direcao que pode ser cima, baixo, esquerda, direita
* @param Step
*/
final public void cmd_direct_pointer(Step p) throws ParseException {
Stack<Object> var_stack = new Stack<Object>();
Point posicaoApontada;
variavel(var_stack);
jj_consume_token(KW_POINT);
posicaoApontada = coordenadas();
jj_consume_token(SEMICOLON);
p.addCommand(new CommandDirectPointer(var_stack, posicaoApontada));
}
/**
* Cria um tamanho escalar (size)
*/
final public Integer size() throws ParseException {
Token t_size;
t_size = jj_consume_token(INT_NUMBER);
{if (true) return Integer.parseInt(t_size.image);}
throw new Error("Missing return statement in function");
}
/**
* Coloca uma variável identificada na pilha de variáveis
* @param Stack<Object> var_stac
*/
final public void variavel(Stack<Object> var_stack) throws ParseException {
Token t_name;
Index i;
t_name = jj_consume_token(IDENTIFIER);
var_stack.push(t_name.image);
label_3:
while (true) {
if (jj_2_61(3)) {
;
} else {
break label_3;
}
if (jj_2_62(3)) {
i = index();
var_stack.push(i);
} else if (jj_2_63(3)) {
jj_consume_token(DOT);
t_name = jj_consume_token(IDENTIFIER);
var_stack.push(t_name.image);
} else {
jj_consume_token(-1);
throw new ParseException();
}
}
}
/**
* Retorna um literal (inteiro, numérico, string, char, boolena etc.)
*/
final public Object constant() throws ParseException {
Token sinal = null;
Token constante;
if (jj_2_70(3)) {
if (jj_2_66(3)) {
if (jj_2_64(3)) {
sinal = jj_consume_token(ADD_OP);
} else if (jj_2_65(3)) {
sinal = jj_consume_token(SUB_OP);
} else {
jj_consume_token(-1);
throw new ParseException();
}
} else {
;
}
constante = jj_consume_token(INT_NUMBER);
if(sinal != null)
{if (true) return Integer.parseInt(sinal.image + constante.image);}
else
{if (true) return Integer.parseInt(constante.image);}
} else if (jj_2_71(3)) {
if (jj_2_69(3)) {
if (jj_2_67(3)) {
sinal = jj_consume_token(ADD_OP);
} else if (jj_2_68(3)) {
sinal = jj_consume_token(SUB_OP);
} else {
jj_consume_token(-1);
throw new ParseException();
}
} else {
;
}
constante = jj_consume_token(FLOAT_NUMBER);
if(sinal != null)
{if (true) return Double.parseDouble(sinal.image + constante.image);}
else
{if (true) return Double.parseDouble(constante.image);}
} else if (jj_2_72(3)) {
constante = jj_consume_token(STRING_LITERAL);
{if (true) return tratarString(constante.image);}
} else if (jj_2_73(3)) {
constante = jj_consume_token(CHAR_LITERAL);
{if (true) return tratarChar(constante.image);}
} else if (jj_2_74(3)) {
constante = jj_consume_token(KW_TRUE);
{if (true) return new Boolean(true);}
} else if (jj_2_75(3)) {
constante = jj_consume_token(KW_FALSE);
{if (true) return new Boolean(false);}
} else if (jj_2_76(3)) {
constante = jj_consume_token(KW_NULL);
{if (true) return null;}
} else {
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
/**
* Cria um novo arquivo adicionando-o no passo.
* @param Step p
*/
final public void cmd_new_file(Step p) throws ParseException {
Token t_name;
jj_consume_token(KW_TEXT);
t_name = jj_consume_token(IDENTIFIER);
p.addCommand(new CommandNewVarText(t_name.image));
label_4:
while (true) {
if (jj_2_77(3)) {
;
} else {
break label_4;
}
jj_consume_token(COMMA);
t_name = jj_consume_token(IDENTIFIER);
p.addCommand(new CommandNewVarText(t_name.image));
}
jj_consume_token(SEMICOLON);
}
/**
* Declara uma nova função, colocando-a no passo.
* @param Step p
*/
final public void function_declaration(Step p) throws ParseException {
Token t_name;
Type type;
List<VarDefinition> param;
List<VarDefinition> local_vars;
jj_consume_token(KW_FUNCTION);
t_name = jj_consume_token(IDENTIFIER);
jj_consume_token(OPEN_PAR);
param = param_list();
jj_consume_token(CLOSE_PAR);
jj_consume_token(COLON);
type = function_type();
local_vars = local_vars_block();
p.addCommand(new FunctionDeclaration(
t_name.image, param, type, local_vars));
}
/**
* Cria uma lista de variáveis a serem passadas como parâmetro.
* @return List<VarDefinition> lista com definições de variáveis.
*/
final public List<VarDefinition> param_list() throws ParseException {
List<VarDefinition> aux;
List<VarDefinition> vars = new ArrayList<VarDefinition>();
label_5:
while (true) {
if (jj_2_78(3)) {
;
} else {
break label_5;
}
aux = new_vars();
vars.addAll(aux);
}
{if (true) return vars;}
throw new Error("Missing return statement in function");
}
/**
* Possibilidades para o tipo de função.
* @return Type tipo da função
*/
final public Type function_type() throws ParseException {
Token t;
if (jj_2_79(3)) {
t = jj_consume_token(KW_INT);
{if (true) return new Type(TypeId.INTEGER);}
} else if (jj_2_80(3)) {
t = jj_consume_token(KW_REAL);
{if (true) return new Type(TypeId.REAL);}
} else if (jj_2_81(3)) {
t = jj_consume_token(KW_CHAR);
{if (true) return new Type(TypeId.CHAR);}
} else if (jj_2_82(3)) {
t = jj_consume_token(KW_STRING);
{if (true) return new Type(TypeId.STRING);}
} else if (jj_2_83(3)) {
t = jj_consume_token(KW_BOOLEAN);
{if (true) return new Type(TypeId.BOOLEAN);}
} else if (jj_2_84(3)) {
t = jj_consume_token(KW_POINTER);
{if (true) return new Type(TypeId.POINTER);}
} else if (jj_2_85(3)) {
t = jj_consume_token(KW_VOID);
{if (true) return new Type(TypeId.VOID);}
} else if (jj_2_86(3)) {
t = jj_consume_token(IDENTIFIER);
{if (true) return new Type(TypeId.RECORD, t.image);}
} else {
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
/**
* Cria uma lista de variáveis locais a uma função.
* @return List<VarDefinition> lista de variáveis locais a uma função.
*/
final public List<VarDefinition> local_vars_block() throws ParseException {
List<VarDefinition> vars = new ArrayList<VarDefinition>();
List<VarDefinition> aux;
if (jj_2_88(3)) {
jj_consume_token(SEMICOLON);
} else if (jj_2_89(3)) {
jj_consume_token(OPEN_BRACE);
label_6:
while (true) {
if (jj_2_87(3)) {
;
} else {
break label_6;
}
aux = new_vars();
vars.addAll(aux);
}
jj_consume_token(CLOSE_BRACE);
jj_consume_token(SEMICOLON);
} else {
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return vars;}
throw new Error("Missing return statement in function");
}
/**
* Cria um comando de inicialização de uma função, adicionando-o ao passo.
* @param Step p
*/
final public void function_start(Step p) throws ParseException {
Token t;
List<Object> args;
jj_consume_token(KW_START);
t = jj_consume_token(IDENTIFIER);
args = lst_args();
jj_consume_token(SEMICOLON);
p.addCommand(new CommandStartFunction(t.image, args));
}
/**
* Cria um comando para finalizar uma função, adicionando-o ao passo.
* @param Step p
*/
final public void function_end(Step p) throws ParseException {
Token t;
jj_consume_token(KW_END);
jj_consume_token(SEMICOLON);
p.addCommand(new CommandEndFunction());
}
/**
* Chama um comando de operação de sistema e adiciona-a ao passo.
* @param Step p
*/
final public void operation_call(Step p) throws ParseException {
Token cmd;
List<Object> args;
cmd = operation();
args = lst_args();
jj_consume_token(SEMICOLON);
p.addCommand(new CommandOperationCall(cmd, args));
}
/**
* Define os tipos de operação do sistema (escreve no console, escreve em nova linha do
* console, comentário, som, etc.).
* @return Token tipo de operação de sistema.
*/
final public Token operation() throws ParseException {
Token cmd;
if (jj_2_90(3)) {
cmd = jj_consume_token(KW_WRITE);
} else if (jj_2_91(3)) {
cmd = jj_consume_token(KW_WRITELN);
} else if (jj_2_92(3)) {
cmd = jj_consume_token(KW_COMMENT);
} else if (jj_2_93(3)) {
cmd = jj_consume_token(KW_SOUND);
} else if (jj_2_94(3)) {
cmd = jj_consume_token(KW_ASSIGN);
} else if (jj_2_95(3)) {
cmd = jj_consume_token(KW_RESET);
} else if (jj_2_96(3)) {
cmd = jj_consume_token(KW_REWRITE);
} else if (jj_2_97(3)) {
cmd = jj_consume_token(KW_READ);
} else if (jj_2_98(3)) {
cmd = jj_consume_token(KW_READLN);
} else if (jj_2_99(3)) {
cmd = jj_consume_token(KW_CLOSE);
} else {
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return cmd;}
throw new Error("Missing return statement in function");
}
/**
* Cria uma lista de argumentos passados para uma função.
* @return List<Object> lista de argumentos passados para a função.
*/
final public List<Object> lst_args() throws ParseException {
Object a;
List<Object> result = new ArrayList<Object>();
jj_consume_token(OPEN_PAR);
if (jj_2_100(3)) {
a = arg();
result.add(a);
} else {
;
}
label_7:
while (true) {
if (jj_2_101(3)) {
;
} else {
break label_7;
}
jj_consume_token(COMMA);
a = arg();
result.add(a);
}
jj_consume_token(CLOSE_PAR);
{if (true) return result;}
throw new Error("Missing return statement in function");
}
/**
* Cria o argumento de uma função (variável, constante ou variável.
* @return Object
*/
final public Object arg() throws ParseException {
Object o;
Stack<Object> var_stack = new Stack<Object>();
if (jj_2_102(3)) {
variavel(var_stack);
{if (true) return var_stack;}
} else if (jj_2_103(3)) {
o = constant();
{if (true) return o;}
} else if (jj_2_104(3)) {
jj_consume_token(KW_ENDERECO);
variavel(var_stack);
{if (true) return var_stack;}
} else {
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
/**
* Define um conjunto de comandos (bloco de comandos) para adicionar ao passo. Afinal, um
* passo pode possuir um comando, ou uma lista de comandos.
* @param Step p.
*/
final public void bloco(Step p) throws ParseException {
jj_consume_token(OPEN_BRACE);
label_8:
while (true) {
if (jj_2_105(3)) {
;
} else {
break label_8;
}
if (jj_2_106(3)) {
label(p);
} else {
;
}
command(p);
}
jj_consume_token(CLOSE_BRACE);
}
private boolean jj_2_1(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_1(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(0, xla); }
}
private boolean jj_2_2(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_2(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(1, xla); }
}
private boolean jj_2_3(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_3(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(2, xla); }
}
private boolean jj_2_4(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_4(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(3, xla); }
}
private boolean jj_2_5(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_5(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(4, xla); }
}
private boolean jj_2_6(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_6(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(5, xla); }
}
private boolean jj_2_7(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_7(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(6, xla); }
}
private boolean jj_2_8(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_8(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(7, xla); }
}
private boolean jj_2_9(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_9(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(8, xla); }
}
private boolean jj_2_10(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_10(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(9, xla); }
}
private boolean jj_2_11(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_11(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(10, xla); }
}
private boolean jj_2_12(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_12(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(11, xla); }
}
private boolean jj_2_13(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_13(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(12, xla); }
}
private boolean jj_2_14(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_14(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(13, xla); }
}
private boolean jj_2_15(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_15(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(14, xla); }
}
private boolean jj_2_16(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_16(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(15, xla); }
}
private boolean jj_2_17(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_17(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(16, xla); }
}
private boolean jj_2_18(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_18(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(17, xla); }
}
private boolean jj_2_19(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_19(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(18, xla); }
}
private boolean jj_2_20(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_20(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(19, xla); }
}
private boolean jj_2_21(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_21(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(20, xla); }
}
private boolean jj_2_22(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_22(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(21, xla); }
}
private boolean jj_2_23(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_23(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(22, xla); }
}
private boolean jj_2_24(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_24(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(23, xla); }
}
private boolean jj_2_25(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_25(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(24, xla); }
}
private boolean jj_2_26(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_26(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(25, xla); }
}
private boolean jj_2_27(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_27(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(26, xla); }
}
private boolean jj_2_28(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_28(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(27, xla); }
}
private boolean jj_2_29(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_29(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(28, xla); }
}
private boolean jj_2_30(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_30(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(29, xla); }
}
private boolean jj_2_31(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_31(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(30, xla); }
}
private boolean jj_2_32(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_32(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(31, xla); }
}
private boolean jj_2_33(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_33(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(32, xla); }
}
private boolean jj_2_34(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_34(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(33, xla); }
}
private boolean jj_2_35(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_35(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(34, xla); }
}
private boolean jj_2_36(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_36(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(35, xla); }
}
private boolean jj_2_37(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_37(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(36, xla); }
}
private boolean jj_2_38(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_38(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(37, xla); }
}
private boolean jj_2_39(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_39(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(38, xla); }
}
private boolean jj_2_40(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_40(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(39, xla); }
}
private boolean jj_2_41(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_41(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(40, xla); }
}
private boolean jj_2_42(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_42(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(41, xla); }
}
private boolean jj_2_43(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_43(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(42, xla); }
}
private boolean jj_2_44(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_44(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(43, xla); }
}
private boolean jj_2_45(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_45(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(44, xla); }
}
private boolean jj_2_46(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_46(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(45, xla); }
}
private boolean jj_2_47(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_47(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(46, xla); }
}
private boolean jj_2_48(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_48(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(47, xla); }
}
private boolean jj_2_49(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_49(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(48, xla); }
}
private boolean jj_2_50(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_50(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(49, xla); }
}
private boolean jj_2_51(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_51(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(50, xla); }
}
private boolean jj_2_52(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_52(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(51, xla); }
}
private boolean jj_2_53(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_53(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(52, xla); }
}
private boolean jj_2_54(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_54(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(53, xla); }
}
private boolean jj_2_55(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_55(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(54, xla); }
}
private boolean jj_2_56(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_56(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(55, xla); }
}
private boolean jj_2_57(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_57(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(56, xla); }
}
private boolean jj_2_58(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_58(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(57, xla); }
}
private boolean jj_2_59(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_59(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(58, xla); }
}
private boolean jj_2_60(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_60(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(59, xla); }
}
private boolean jj_2_61(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_61(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(60, xla); }
}
private boolean jj_2_62(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_62(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(61, xla); }
}
private boolean jj_2_63(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_63(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(62, xla); }
}
private boolean jj_2_64(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_64(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(63, xla); }
}
private boolean jj_2_65(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_65(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(64, xla); }
}
private boolean jj_2_66(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_66(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(65, xla); }
}
private boolean jj_2_67(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_67(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(66, xla); }
}
private boolean jj_2_68(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_68(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(67, xla); }
}
private boolean jj_2_69(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_69(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(68, xla); }
}
private boolean jj_2_70(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_70(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(69, xla); }
}
private boolean jj_2_71(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_71(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(70, xla); }
}
private boolean jj_2_72(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_72(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(71, xla); }
}
private boolean jj_2_73(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_73(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(72, xla); }
}
private boolean jj_2_74(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_74(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(73, xla); }
}
private boolean jj_2_75(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_75(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(74, xla); }
}
private boolean jj_2_76(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_76(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(75, xla); }
}
private boolean jj_2_77(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_77(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(76, xla); }
}
private boolean jj_2_78(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_78(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(77, xla); }
}
private boolean jj_2_79(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_79(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(78, xla); }
}
private boolean jj_2_80(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_80(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(79, xla); }
}
private boolean jj_2_81(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_81(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(80, xla); }
}
private boolean jj_2_82(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_82(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(81, xla); }
}
private boolean jj_2_83(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_83(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(82, xla); }
}
private boolean jj_2_84(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_84(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(83, xla); }
}
private boolean jj_2_85(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_85(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(84, xla); }
}
private boolean jj_2_86(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_86(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(85, xla); }
}
private boolean jj_2_87(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_87(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(86, xla); }
}
private boolean jj_2_88(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_88(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(87, xla); }
}
private boolean jj_2_89(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_89(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(88, xla); }
}
private boolean jj_2_90(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_90(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(89, xla); }
}
private boolean jj_2_91(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_91(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(90, xla); }
}
private boolean jj_2_92(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_92(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(91, xla); }
}
private boolean jj_2_93(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_93(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(92, xla); }
}
private boolean jj_2_94(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_94(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(93, xla); }
}
private boolean jj_2_95(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_95(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(94, xla); }
}
private boolean jj_2_96(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_96(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(95, xla); }
}
private boolean jj_2_97(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_97(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(96, xla); }
}
private boolean jj_2_98(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_98(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(97, xla); }
}
private boolean jj_2_99(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_99(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(98, xla); }
}
private boolean jj_2_100(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_100(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(99, xla); }
}
private boolean jj_2_101(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_101(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(100, xla); }
}
private boolean jj_2_102(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_102(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(101, xla); }
}
private boolean jj_2_103(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_103(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(102, xla); }
}
private boolean jj_2_104(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_104(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(103, xla); }
}
private boolean jj_2_105(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_105(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(104, xla); }
}
private boolean jj_2_106(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_106(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(105, xla); }
}
private boolean jj_3R_11() {
if (jj_scan_token(KW_RECORD)) return true;
if (jj_scan_token(IDENTIFIER)) return true;
if (jj_scan_token(OPEN_BRACE)) return true;
return false;
}
private boolean jj_3_77() {
if (jj_scan_token(COMMA)) return true;
if (jj_scan_token(IDENTIFIER)) return true;
return false;
}
private boolean jj_3R_15() {
if (jj_scan_token(KW_TEXT)) return true;
if (jj_scan_token(IDENTIFIER)) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_77()) { jj_scanpos = xsp; break; }
}
if (jj_scan_token(SEMICOLON)) return true;
return false;
}
private boolean jj_3R_24() {
if (jj_scan_token(KW_INSERE_TEXTO)) return true;
if (jj_3R_50()) return true;
return false;
}
private boolean jj_3_68() {
if (jj_scan_token(SUB_OP)) return true;
return false;
}
private boolean jj_3_76() {
if (jj_scan_token(KW_NULL)) return true;
return false;
}
private boolean jj_3_75() {
if (jj_scan_token(KW_FALSE)) return true;
return false;
}
private boolean jj_3_65() {
if (jj_scan_token(SUB_OP)) return true;
return false;
}
private boolean jj_3_74() {
if (jj_scan_token(KW_TRUE)) return true;
return false;
}
private boolean jj_3_73() {
if (jj_scan_token(CHAR_LITERAL)) return true;
return false;
}
private boolean jj_3_72() {
if (jj_scan_token(STRING_LITERAL)) return true;
return false;
}
private boolean jj_3R_16() {
if (jj_scan_token(KW_GOTO)) return true;
if (jj_scan_token(OPEN_PAR)) return true;
if (jj_scan_token(IDENTIFIER)) return true;
return false;
}
private boolean jj_3_69() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_67()) {
jj_scanpos = xsp;
if (jj_3_68()) return true;
}
return false;
}
private boolean jj_3_67() {
if (jj_scan_token(ADD_OP)) return true;
return false;
}
private boolean jj_3_71() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_69()) jj_scanpos = xsp;
if (jj_scan_token(FLOAT_NUMBER)) return true;
return false;
}
private boolean jj_3_66() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_64()) {
jj_scanpos = xsp;
if (jj_3_65()) return true;
}
return false;
}
private boolean jj_3_64() {
if (jj_scan_token(ADD_OP)) return true;
return false;
}
private boolean jj_3_70() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_66()) jj_scanpos = xsp;
if (jj_scan_token(INT_NUMBER)) return true;
return false;
}
private boolean jj_3R_30() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_70()) {
jj_scanpos = xsp;
if (jj_3_71()) {
jj_scanpos = xsp;
if (jj_3_72()) {
jj_scanpos = xsp;
if (jj_3_73()) {
jj_scanpos = xsp;
if (jj_3_74()) {
jj_scanpos = xsp;
if (jj_3_75()) {
jj_scanpos = xsp;
if (jj_3_76()) return true;
}
}
}
}
}
}
return false;
}
private boolean jj_3_41() {
if (jj_scan_token(MOD_OP)) return true;
return false;
}
private boolean jj_3_40() {
if (jj_scan_token(DIV_OP)) return true;
return false;
}
private boolean jj_3_39() {
if (jj_scan_token(MULT_OP)) return true;
return false;
}
private boolean jj_3_63() {
if (jj_scan_token(DOT)) return true;
if (jj_scan_token(IDENTIFIER)) return true;
return false;
}
private boolean jj_3_42() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_39()) {
jj_scanpos = xsp;
if (jj_3_40()) {
jj_scanpos = xsp;
if (jj_3_41()) return true;
}
}
if (jj_3R_37()) return true;
return false;
}
private boolean jj_3_62() {
if (jj_3R_40()) return true;
return false;
}
private boolean jj_3_61() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_62()) {
jj_scanpos = xsp;
if (jj_3_63()) return true;
}
return false;
}
private boolean jj_3_37() {
if (jj_scan_token(SUB_OP)) return true;
return false;
}
private boolean jj_3_36() {
if (jj_scan_token(ADD_OP)) return true;
return false;
}
private boolean jj_3_38() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_36()) {
jj_scanpos = xsp;
if (jj_3_37()) return true;
}
if (jj_3R_36()) return true;
return false;
}
private boolean jj_3R_37() {
if (jj_3R_28()) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_42()) jj_scanpos = xsp;
return false;
}
private boolean jj_3R_29() {
if (jj_scan_token(IDENTIFIER)) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_61()) { jj_scanpos = xsp; break; }
}
return false;
}
private boolean jj_3_34() {
if (jj_scan_token(GE_OP)) return true;
return false;
}
private boolean jj_3_33() {
if (jj_scan_token(LE_OP)) return true;
return false;
}
private boolean jj_3_32() {
if (jj_scan_token(GT_OP)) return true;
return false;
}
private boolean jj_3R_36() {
if (jj_3R_37()) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_38()) jj_scanpos = xsp;
return false;
}
private boolean jj_3_31() {
if (jj_scan_token(LT_OP)) return true;
return false;
}
private boolean jj_3_35() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_31()) {
jj_scanpos = xsp;
if (jj_3_32()) {
jj_scanpos = xsp;
if (jj_3_33()) {
jj_scanpos = xsp;
if (jj_3_34()) return true;
}
}
}
if (jj_3R_35()) return true;
return false;
}
private boolean jj_3_29() {
if (jj_scan_token(NE_OP)) return true;
return false;
}
private boolean jj_3_28() {
if (jj_scan_token(EQ_OP)) return true;
return false;
}
private boolean jj_3_30() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_28()) {
jj_scanpos = xsp;
if (jj_3_29()) return true;
}
if (jj_3R_34()) return true;
return false;
}
private boolean jj_3R_35() {
if (jj_3R_36()) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_35()) jj_scanpos = xsp;
return false;
}
private boolean jj_3R_34() {
if (jj_3R_35()) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_30()) jj_scanpos = xsp;
return false;
}
private boolean jj_3R_14() {
if (jj_3R_29()) return true;
if (jj_scan_token(KW_POINT)) return true;
if (jj_3R_47()) return true;
return false;
}
private boolean jj_3_27() {
if (jj_scan_token(AND_OP)) return true;
if (jj_3R_33()) return true;
return false;
}
private boolean jj_3R_33() {
if (jj_3R_34()) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_27()) jj_scanpos = xsp;
return false;
}
private boolean jj_3_26() {
if (jj_scan_token(OR_OP)) return true;
if (jj_3R_32()) return true;
return false;
}
private boolean jj_3R_32() {
if (jj_3R_33()) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_26()) jj_scanpos = xsp;
return false;
}
private boolean jj_3R_13() {
if (jj_3R_29()) return true;
if (jj_scan_token(ATTRIBUTION)) return true;
if (jj_3R_31()) return true;
return false;
}
private boolean jj_3_25() {
if (jj_scan_token(OPEN_PAR)) return true;
if (jj_3R_31()) return true;
if (jj_scan_token(CLOSE_PAR)) return true;
return false;
}
private boolean jj_3_24() {
if (jj_3R_30()) return true;
return false;
}
private boolean jj_3_23() {
if (jj_3R_29()) return true;
return false;
}
private boolean jj_3R_26() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_23()) {
jj_scanpos = xsp;
if (jj_3_24()) {
jj_scanpos = xsp;
if (jj_3_25()) return true;
}
}
return false;
}
private boolean jj_3R_27() {
if (jj_scan_token(NOT_OP)) return true;
return false;
}
private boolean jj_3R_51() {
if (jj_3R_32()) return true;
return false;
}
private boolean jj_3R_19() {
if (jj_scan_token(KW_REMOVE_VAR)) return true;
if (jj_scan_token(OPEN_PAR)) return true;
if (jj_3R_29()) return true;
return false;
}
private boolean jj_3_22() {
if (jj_3R_27()) return true;
if (jj_3R_28()) return true;
return false;
}
private boolean jj_3_21() {
if (jj_3R_26()) return true;
return false;
}
private boolean jj_3R_28() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_21()) {
jj_scanpos = xsp;
if (jj_3_22()) return true;
}
return false;
}
private boolean jj_3R_12() {
if (jj_3R_38()) return true;
return false;
}
private boolean jj_3R_31() {
if (jj_3R_51()) return true;
return false;
}
private boolean jj_3_60() {
if (jj_scan_token(COMMA)) return true;
if (jj_scan_token(INT_NUMBER)) return true;
return false;
}
private boolean jj_3R_40() {
if (jj_scan_token(OPEN_BRACKET)) return true;
if (jj_scan_token(INT_NUMBER)) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_60()) jj_scanpos = xsp;
if (jj_scan_token(CLOSE_BRACKET)) return true;
return false;
}
private boolean jj_3_59() {
if (jj_scan_token(KW_FALSE)) return true;
return false;
}
private boolean jj_3R_17() {
if (jj_scan_token(KW_IF)) return true;
if (jj_scan_token(OPEN_PAR)) return true;
if (jj_3R_31()) return true;
return false;
}
private boolean jj_3_106() {
if (jj_3R_9()) return true;
return false;
}
private boolean jj_3R_18() {
if (jj_scan_token(KW_READ_FROM_USER)) return true;
if (jj_scan_token(OPEN_PAR)) return true;
if (jj_3R_29()) return true;
return false;
}
private boolean jj_3_105() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_106()) jj_scanpos = xsp;
if (jj_3R_10()) return true;
return false;
}
private boolean jj_3R_47() {
if (jj_scan_token(OPEN_PAR)) return true;
if (jj_scan_token(INT_NUMBER)) return true;
return false;
}
private boolean jj_3R_25() {
if (jj_scan_token(OPEN_BRACE)) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_105()) { jj_scanpos = xsp; break; }
}
if (jj_scan_token(CLOSE_BRACE)) return true;
return false;
}
private boolean jj_3R_9() {
if (jj_scan_token(IDENTIFIER)) return true;
if (jj_scan_token(COLON)) return true;
return false;
}
private boolean jj_3_104() {
if (jj_scan_token(KW_ENDERECO)) return true;
if (jj_3R_29()) return true;
return false;
}
private boolean jj_3_103() {
if (jj_3R_30()) return true;
return false;
}
private boolean jj_3R_46() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_102()) {
jj_scanpos = xsp;
if (jj_3_103()) {
jj_scanpos = xsp;
if (jj_3_104()) return true;
}
}
return false;
}
private boolean jj_3_102() {
if (jj_3R_29()) return true;
return false;
}
private boolean jj_3_58() {
if (jj_scan_token(KW_TRUE)) return true;
return false;
}
private boolean jj_3_20() {
if (jj_3R_25()) return true;
return false;
}
private boolean jj_3_19() {
if (jj_3R_24()) return true;
return false;
}
private boolean jj_3R_45() {
if (jj_scan_token(KW_SHOW_NAME)) return true;
if (jj_scan_token(OPEN_PAR)) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_58()) {
jj_scanpos = xsp;
if (jj_3_59()) return true;
}
return false;
}
private boolean jj_3_18() {
if (jj_3R_23()) return true;
return false;
}
private boolean jj_3_17() {
if (jj_3R_22()) return true;
return false;
}
private boolean jj_3_16() {
if (jj_3R_21()) return true;
return false;
}
private boolean jj_3_15() {
if (jj_3R_20()) return true;
return false;
}
private boolean jj_3_14() {
if (jj_3R_19()) return true;
return false;
}
private boolean jj_3_13() {
if (jj_3R_18()) return true;
return false;
}
private boolean jj_3_12() {
if (jj_3R_17()) return true;
return false;
}
private boolean jj_3_11() {
if (jj_3R_16()) return true;
return false;
}
private boolean jj_3_101() {
if (jj_scan_token(COMMA)) return true;
if (jj_3R_46()) return true;
return false;
}
private boolean jj_3_10() {
if (jj_3R_15()) return true;
return false;
}
private boolean jj_3_100() {
if (jj_3R_46()) return true;
return false;
}
private boolean jj_3_9() {
if (jj_3R_14()) return true;
return false;
}
private boolean jj_3_8() {
if (jj_3R_13()) return true;
return false;
}
private boolean jj_3_7() {
if (jj_3R_12()) return true;
return false;
}
private boolean jj_3R_48() {
if (jj_scan_token(OPEN_PAR)) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_100()) jj_scanpos = xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_101()) { jj_scanpos = xsp; break; }
}
if (jj_scan_token(CLOSE_PAR)) return true;
return false;
}
private boolean jj_3_6() {
if (jj_3R_11()) return true;
return false;
}
private boolean jj_3_5() {
if (jj_scan_token(SEMICOLON)) return true;
return false;
}
private boolean jj_3R_10() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_5()) {
jj_scanpos = xsp;
if (jj_3_6()) {
jj_scanpos = xsp;
if (jj_3_7()) {
jj_scanpos = xsp;
if (jj_3_8()) {
jj_scanpos = xsp;
if (jj_3_9()) {
jj_scanpos = xsp;
if (jj_3_10()) {
jj_scanpos = xsp;
if (jj_3_11()) {
jj_scanpos = xsp;
if (jj_3_12()) {
jj_scanpos = xsp;
if (jj_3_13()) {
jj_scanpos = xsp;
if (jj_3_14()) {
jj_scanpos = xsp;
if (jj_3_15()) {
jj_scanpos = xsp;
if (jj_3_16()) {
jj_scanpos = xsp;
if (jj_3_17()) {
jj_scanpos = xsp;
if (jj_3_18()) {
jj_scanpos = xsp;
if (jj_3_19()) {
jj_scanpos = xsp;
if (jj_3_20()) return true;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return false;
}
private boolean jj_3R_44() {
if (jj_scan_token(KW_POSITION)) return true;
if (jj_3R_47()) return true;
return false;
}
private boolean jj_3_2() {
if (jj_3R_9()) return true;
return false;
}
private boolean jj_3_1() {
if (jj_scan_token(KW_LINE)) return true;
return false;
}
private boolean jj_3_4() {
if (jj_scan_token(0)) return true;
return false;
}
private boolean jj_3_99() {
if (jj_scan_token(KW_CLOSE)) return true;
return false;
}
private boolean jj_3_98() {
if (jj_scan_token(KW_READLN)) return true;
return false;
}
private boolean jj_3R_50() {
if (jj_scan_token(KW_CONTEUDO)) return true;
if (jj_scan_token(OPEN_PAR)) return true;
return false;
}
private boolean jj_3_97() {
if (jj_scan_token(KW_READ)) return true;
return false;
}
private boolean jj_3_96() {
if (jj_scan_token(KW_REWRITE)) return true;
return false;
}
private boolean jj_3_95() {
if (jj_scan_token(KW_RESET)) return true;
return false;
}
private boolean jj_3_3() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_1()) jj_scanpos = xsp;
if (jj_scan_token(INT_NUMBER)) return true;
xsp = jj_scanpos;
if (jj_3_2()) jj_scanpos = xsp;
if (jj_3R_10()) return true;
return false;
}
private boolean jj_3_94() {
if (jj_scan_token(KW_ASSIGN)) return true;
return false;
}
private boolean jj_3_93() {
if (jj_scan_token(KW_SOUND)) return true;
return false;
}
private boolean jj_3_92() {
if (jj_scan_token(KW_COMMENT)) return true;
return false;
}
private boolean jj_3_90() {
if (jj_scan_token(KW_WRITE)) return true;
return false;
}
private boolean jj_3_91() {
if (jj_scan_token(KW_WRITELN)) return true;
return false;
}
private boolean jj_3R_49() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_90()) {
jj_scanpos = xsp;
if (jj_3_91()) {
jj_scanpos = xsp;
if (jj_3_92()) {
jj_scanpos = xsp;
if (jj_3_93()) {
jj_scanpos = xsp;
if (jj_3_94()) {
jj_scanpos = xsp;
if (jj_3_95()) {
jj_scanpos = xsp;
if (jj_3_96()) {
jj_scanpos = xsp;
if (jj_3_97()) {
jj_scanpos = xsp;
if (jj_3_98()) {
jj_scanpos = xsp;
if (jj_3_99()) return true;
}
}
}
}
}
}
}
}
}
return false;
}
private boolean jj_3R_43() {
if (jj_scan_token(KW_DIMENSION)) return true;
if (jj_scan_token(OPEN_PAR)) return true;
if (jj_scan_token(INT_NUMBER)) return true;
return false;
}
private boolean jj_3R_23() {
if (jj_3R_49()) return true;
if (jj_3R_48()) return true;
return false;
}
private boolean jj_3R_22() {
if (jj_scan_token(KW_END)) return true;
if (jj_scan_token(SEMICOLON)) return true;
return false;
}
private boolean jj_3R_42() {
if (jj_scan_token(KW_COLOR_INSIDE)) return true;
if (jj_scan_token(OPEN_PAR)) return true;
if (jj_scan_token(INT_NUMBER)) return true;
return false;
}
private boolean jj_3_87() {
if (jj_3R_38()) return true;
return false;
}
private boolean jj_3R_21() {
if (jj_scan_token(KW_START)) return true;
if (jj_scan_token(IDENTIFIER)) return true;
if (jj_3R_48()) return true;
return false;
}
private boolean jj_3R_41() {
if (jj_scan_token(KW_COLOR)) return true;
if (jj_scan_token(OPEN_PAR)) return true;
if (jj_scan_token(INT_NUMBER)) return true;
return false;
}
private boolean jj_3_89() {
if (jj_scan_token(OPEN_BRACE)) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_87()) { jj_scanpos = xsp; break; }
}
if (jj_scan_token(CLOSE_BRACE)) return true;
if (jj_scan_token(SEMICOLON)) return true;
return false;
}
private boolean jj_3_88() {
if (jj_scan_token(SEMICOLON)) return true;
return false;
}
private boolean jj_3_57() {
if (jj_3R_45()) return true;
return false;
}
private boolean jj_3_56() {
if (jj_3R_44()) return true;
return false;
}
private boolean jj_3_55() {
if (jj_3R_43()) return true;
return false;
}
private boolean jj_3_54() {
if (jj_3R_42()) return true;
return false;
}
private boolean jj_3_86() {
if (jj_scan_token(IDENTIFIER)) return true;
return false;
}
private boolean jj_3_53() {
if (jj_3R_41()) return true;
return false;
}
private boolean jj_3_85() {
if (jj_scan_token(KW_VOID)) return true;
return false;
}
private boolean jj_3_52() {
if (jj_3R_40()) return true;
return false;
}
private boolean jj_3_84() {
if (jj_scan_token(KW_POINTER)) return true;
return false;
}
private boolean jj_3_83() {
if (jj_scan_token(KW_BOOLEAN)) return true;
return false;
}
private boolean jj_3R_39() {
if (jj_scan_token(IDENTIFIER)) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_52()) jj_scanpos = xsp;
xsp = jj_scanpos;
if (jj_3_53()) jj_scanpos = xsp;
xsp = jj_scanpos;
if (jj_3_54()) jj_scanpos = xsp;
xsp = jj_scanpos;
if (jj_3_55()) jj_scanpos = xsp;
xsp = jj_scanpos;
if (jj_3_56()) jj_scanpos = xsp;
xsp = jj_scanpos;
if (jj_3_57()) jj_scanpos = xsp;
return false;
}
private boolean jj_3_82() {
if (jj_scan_token(KW_STRING)) return true;
return false;
}
private boolean jj_3_81() {
if (jj_scan_token(KW_CHAR)) return true;
return false;
}
private boolean jj_3_80() {
if (jj_scan_token(KW_REAL)) return true;
return false;
}
private boolean jj_3_79() {
if (jj_scan_token(KW_INT)) return true;
return false;
}
private boolean jj_3_51() {
if (jj_scan_token(IDENTIFIER)) return true;
return false;
}
private boolean jj_3_50() {
if (jj_scan_token(KW_POINTER)) return true;
return false;
}
private boolean jj_3_49() {
if (jj_scan_token(KW_BOOLEAN)) return true;
return false;
}
private boolean jj_3_48() {
if (jj_scan_token(KW_STRING)) return true;
return false;
}
private boolean jj_3_47() {
if (jj_scan_token(KW_CHAR)) return true;
return false;
}
private boolean jj_3_46() {
if (jj_scan_token(KW_REAL)) return true;
return false;
}
private boolean jj_3_45() {
if (jj_scan_token(KW_INT)) return true;
return false;
}
private boolean jj_3_78() {
if (jj_3R_38()) return true;
return false;
}
private boolean jj_3R_52() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_45()) {
jj_scanpos = xsp;
if (jj_3_46()) {
jj_scanpos = xsp;
if (jj_3_47()) {
jj_scanpos = xsp;
if (jj_3_48()) {
jj_scanpos = xsp;
if (jj_3_49()) {
jj_scanpos = xsp;
if (jj_3_50()) {
jj_scanpos = xsp;
if (jj_3_51()) return true;
}
}
}
}
}
}
return false;
}
private boolean jj_3_44() {
if (jj_scan_token(COMMA)) return true;
if (jj_3R_39()) return true;
return false;
}
private boolean jj_3R_38() {
if (jj_3R_52()) return true;
if (jj_3R_39()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_44()) { jj_scanpos = xsp; break; }
}
if (jj_scan_token(SEMICOLON)) return true;
return false;
}
private boolean jj_3_43() {
if (jj_3R_38()) return true;
return false;
}
private boolean jj_3R_20() {
if (jj_scan_token(KW_FUNCTION)) return true;
if (jj_scan_token(IDENTIFIER)) return true;
if (jj_scan_token(OPEN_PAR)) return true;
return false;
}
/** Generated Token Manager. */
public TiraTeimaParserTokenManager token_source;
SimpleCharStream jj_input_stream;
/** Current token. */
public Token token;
/** Next token. */
public Token jj_nt;
private int jj_ntk;
private Token jj_scanpos, jj_lastpos;
private int jj_la;
private int jj_gen;
final private int[] jj_la1 = new int[0];
static private int[] jj_la1_0;
static private int[] jj_la1_1;
static private int[] jj_la1_2;
static {
jj_la1_init_0();
jj_la1_init_1();
jj_la1_init_2();
}
private static void jj_la1_init_0() {
jj_la1_0 = new int[] {};
}
private static void jj_la1_init_1() {
jj_la1_1 = new int[] {};
}
private static void jj_la1_init_2() {
jj_la1_2 = new int[] {};
}
final private JJCalls[] jj_2_rtns = new JJCalls[106];
private boolean jj_rescan = false;
private int jj_gc = 0;
/** Constructor with InputStream. */
public TiraTeimaParser(java.io.InputStream stream) {
this(stream, null);
}
/** Constructor with InputStream and supplied encoding */
public TiraTeimaParser(java.io.InputStream stream, String encoding) {
try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
token_source = new TiraTeimaParserTokenManager(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 0; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
/** Reinitialise. */
public void ReInit(java.io.InputStream stream) {
ReInit(stream, null);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream stream, String encoding) {
try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
token_source.ReInit(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 0; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
/** Constructor. */
public TiraTeimaParser(java.io.Reader stream) {
jj_input_stream = new SimpleCharStream(stream, 1, 1);
token_source = new TiraTeimaParserTokenManager(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 0; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
/** Reinitialise. */
public void ReInit(java.io.Reader stream) {
jj_input_stream.ReInit(stream, 1, 1);
token_source.ReInit(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 0; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
/** Constructor with generated Token Manager. */
public TiraTeimaParser(TiraTeimaParserTokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 0; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
/** Reinitialise. */
public void ReInit(TiraTeimaParserTokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 0; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
private Token jj_consume_token(int kind) throws ParseException {
Token oldToken;
if ((oldToken = token).next != null) token = token.next;
else token = token.next = token_source.getNextToken();
jj_ntk = -1;
if (token.kind == kind) {
jj_gen++;
if (++jj_gc > 100) {
jj_gc = 0;
for (int i = 0; i < jj_2_rtns.length; i++) {
JJCalls c = jj_2_rtns[i];
while (c != null) {
if (c.gen < jj_gen) c.first = null;
c = c.next;
}
}
}
return token;
}
token = oldToken;
jj_kind = kind;
throw generateParseException();
}
static private final class LookaheadSuccess extends java.lang.Error { }
final private LookaheadSuccess jj_ls = new LookaheadSuccess();
private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else {
jj_scanpos = jj_scanpos.next;
}
if (jj_rescan) {
int i = 0; Token tok = token;
while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
if (tok != null) jj_add_error_token(kind, i);
}
if (jj_scanpos.kind != kind) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
return false;
}
/** Get the next Token. */
final public Token getNextToken() {
if (token.next != null) token = token.next;
else token = token.next = token_source.getNextToken();
jj_ntk = -1;
jj_gen++;
return token;
}
/** Get the specific Token. */
final public Token getToken(int index) {
Token t = token;
for (int i = 0; i < index; i++) {
if (t.next != null) t = t.next;
else t = t.next = token_source.getNextToken();
}
return t;
}
private int jj_ntk() {
if ((jj_nt=token.next) == null)
return (jj_ntk = (token.next=token_source.getNextToken()).kind);
else
return (jj_ntk = jj_nt.kind);
}
private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
private int[] jj_expentry;
private int jj_kind = -1;
private int[] jj_lasttokens = new int[100];
private int jj_endpos;
private void jj_add_error_token(int kind, int pos) {
if (pos >= 100) return;
if (pos == jj_endpos + 1) {
jj_lasttokens[jj_endpos++] = kind;
} else if (jj_endpos != 0) {
jj_expentry = new int[jj_endpos];
for (int i = 0; i < jj_endpos; i++) {
jj_expentry[i] = jj_lasttokens[i];
}
jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries.iterator(); it.hasNext();) {
int[] oldentry = (int[])(it.next());
if (oldentry.length == jj_expentry.length) {
for (int i = 0; i < jj_expentry.length; i++) {
if (oldentry[i] != jj_expentry[i]) {
continue jj_entries_loop;
}
}
jj_expentries.add(jj_expentry);
break jj_entries_loop;
}
}
if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
}
}
/** Generate ParseException. */
public ParseException generateParseException() {
jj_expentries.clear();
boolean[] la1tokens = new boolean[81];
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
}
for (int i = 0; i < 0; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
if ((jj_la1_0[i] & (1<<j)) != 0) {
la1tokens[j] = true;
}
if ((jj_la1_1[i] & (1<<j)) != 0) {
la1tokens[32+j] = true;
}
if ((jj_la1_2[i] & (1<<j)) != 0) {
la1tokens[64+j] = true;
}
}
}
}
for (int i = 0; i < 81; i++) {
if (la1tokens[i]) {
jj_expentry = new int[1];
jj_expentry[0] = i;
jj_expentries.add(jj_expentry);
}
}
jj_endpos = 0;
jj_rescan_token();
jj_add_error_token(0, 0);
int[][] exptokseq = new int[jj_expentries.size()][];
for (int i = 0; i < jj_expentries.size(); i++) {
exptokseq[i] = jj_expentries.get(i);
}
return new ParseException(token, exptokseq, tokenImage);
}
/** Enable tracing. */
final public void enable_tracing() {
}
/** Disable tracing. */
final public void disable_tracing() {
}
private void jj_rescan_token() {
jj_rescan = true;
for (int i = 0; i < 106; i++) {
try {
JJCalls p = jj_2_rtns[i];
do {
if (p.gen > jj_gen) {
jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
switch (i) {
case 0: jj_3_1(); break;
case 1: jj_3_2(); break;
case 2: jj_3_3(); break;
case 3: jj_3_4(); break;
case 4: jj_3_5(); break;
case 5: jj_3_6(); break;
case 6: jj_3_7(); break;
case 7: jj_3_8(); break;
case 8: jj_3_9(); break;
case 9: jj_3_10(); break;
case 10: jj_3_11(); break;
case 11: jj_3_12(); break;
case 12: jj_3_13(); break;
case 13: jj_3_14(); break;
case 14: jj_3_15(); break;
case 15: jj_3_16(); break;
case 16: jj_3_17(); break;
case 17: jj_3_18(); break;
case 18: jj_3_19(); break;
case 19: jj_3_20(); break;
case 20: jj_3_21(); break;
case 21: jj_3_22(); break;
case 22: jj_3_23(); break;
case 23: jj_3_24(); break;
case 24: jj_3_25(); break;
case 25: jj_3_26(); break;
case 26: jj_3_27(); break;
case 27: jj_3_28(); break;
case 28: jj_3_29(); break;
case 29: jj_3_30(); break;
case 30: jj_3_31(); break;
case 31: jj_3_32(); break;
case 32: jj_3_33(); break;
case 33: jj_3_34(); break;
case 34: jj_3_35(); break;
case 35: jj_3_36(); break;
case 36: jj_3_37(); break;
case 37: jj_3_38(); break;
case 38: jj_3_39(); break;
case 39: jj_3_40(); break;
case 40: jj_3_41(); break;
case 41: jj_3_42(); break;
case 42: jj_3_43(); break;
case 43: jj_3_44(); break;
case 44: jj_3_45(); break;
case 45: jj_3_46(); break;
case 46: jj_3_47(); break;
case 47: jj_3_48(); break;
case 48: jj_3_49(); break;
case 49: jj_3_50(); break;
case 50: jj_3_51(); break;
case 51: jj_3_52(); break;
case 52: jj_3_53(); break;
case 53: jj_3_54(); break;
case 54: jj_3_55(); break;
case 55: jj_3_56(); break;
case 56: jj_3_57(); break;
case 57: jj_3_58(); break;
case 58: jj_3_59(); break;
case 59: jj_3_60(); break;
case 60: jj_3_61(); break;
case 61: jj_3_62(); break;
case 62: jj_3_63(); break;
case 63: jj_3_64(); break;
case 64: jj_3_65(); break;
case 65: jj_3_66(); break;
case 66: jj_3_67(); break;
case 67: jj_3_68(); break;
case 68: jj_3_69(); break;
case 69: jj_3_70(); break;
case 70: jj_3_71(); break;
case 71: jj_3_72(); break;
case 72: jj_3_73(); break;
case 73: jj_3_74(); break;
case 74: jj_3_75(); break;
case 75: jj_3_76(); break;
case 76: jj_3_77(); break;
case 77: jj_3_78(); break;
case 78: jj_3_79(); break;
case 79: jj_3_80(); break;
case 80: jj_3_81(); break;
case 81: jj_3_82(); break;
case 82: jj_3_83(); break;
case 83: jj_3_84(); break;
case 84: jj_3_85(); break;
case 85: jj_3_86(); break;
case 86: jj_3_87(); break;
case 87: jj_3_88(); break;
case 88: jj_3_89(); break;
case 89: jj_3_90(); break;
case 90: jj_3_91(); break;
case 91: jj_3_92(); break;
case 92: jj_3_93(); break;
case 93: jj_3_94(); break;
case 94: jj_3_95(); break;
case 95: jj_3_96(); break;
case 96: jj_3_97(); break;
case 97: jj_3_98(); break;
case 98: jj_3_99(); break;
case 99: jj_3_100(); break;
case 100: jj_3_101(); break;
case 101: jj_3_102(); break;
case 102: jj_3_103(); break;
case 103: jj_3_104(); break;
case 104: jj_3_105(); break;
case 105: jj_3_106(); break;
}
}
p = p.next;
} while (p != null);
} catch(LookaheadSuccess ls) { }
}
jj_rescan = false;
}
private void jj_save(int index, int xla) {
JJCalls p = jj_2_rtns[index];
while (p.gen > jj_gen) {
if (p.next == null) { p = p.next = new JJCalls(); break; }
p = p.next;
}
p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
}
static final class JJCalls {
int gen;
Token first;
int arg;
JJCalls next;
}
}