#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include "ucfun.h"
#include "ucexpr.h"
#include "ucstmt.h"
#include "opcodes.h"
#include "ucscriptop.h"
Include dependency graph for ucparse.cc:
Go to the source code of this file.
Classes | |
union | yystype |
union | yyalloc |
Defines | |
#define | YYBISON 1 |
#define | IF 257 |
#define | ELSE 258 |
#define | RETURN 259 |
#define | WHILE 260 |
#define | FOR 261 |
#define | UCC_IN 262 |
#define | WITH 263 |
#define | TO 264 |
#define | EXTERN 265 |
#define | BREAK 266 |
#define | GOTO 267 |
#define | CASE 268 |
#define | VAR 269 |
#define | UCC_INT 270 |
#define | UCC_CONST 271 |
#define | STRING 272 |
#define | ENUM 273 |
#define | CONVERSE 274 |
#define | SAY 275 |
#define | MESSAGE 276 |
#define | RESPONSE 277 |
#define | EVENT 278 |
#define | FLAG 279 |
#define | ITEM 280 |
#define | UCTRUE 281 |
#define | UCFALSE 282 |
#define | REMOVE 283 |
#define | ADD 284 |
#define | HIDE 285 |
#define | SCRIPT 286 |
#define | AFTER 287 |
#define | TICKS 288 |
#define | STATIC_ 289 |
#define | ORIGINAL 290 |
#define | CONTINUE 291 |
#define | REPEAT 292 |
#define | NOP 293 |
#define | NOHALT 294 |
#define | WAIT 295 |
#define | RISE 296 |
#define | DESCEND 297 |
#define | FRAME 298 |
#define | HATCH 299 |
#define | NEXT 300 |
#define | PREVIOUS 301 |
#define | CYCLE 302 |
#define | STEP 303 |
#define | MUSIC 304 |
#define | CALL 305 |
#define | SPEECH 306 |
#define | SFX 307 |
#define | FACE 308 |
#define | HIT 309 |
#define | HOURS 310 |
#define | ACTOR 311 |
#define | NORTH 312 |
#define | SOUTH 313 |
#define | EAST 314 |
#define | WEST 315 |
#define | NE 316 |
#define | NW 317 |
#define | SE 318 |
#define | SW 319 |
#define | STRING_LITERAL 320 |
#define | STRING_PREFIX 321 |
#define | IDENTIFIER 322 |
#define | INT_LITERAL 323 |
#define | AND 324 |
#define | OR 325 |
#define | EQUALS 326 |
#define | NEQUALS 327 |
#define | LTEQUALS 328 |
#define | GTEQUALS 329 |
#define | NOT 330 |
#define | UCC_POINTS 331 |
#define | YYERROR_VERBOSE 1 |
#define | YYSTYPE yystype |
#define | YYSTYPE_IS_TRIVIAL 1 |
#define | YYDEBUG 0 |
#define | YYFINAL 374 |
#define | YYFLAG -32768 |
#define | YYNTBASE 97 |
#define | YYTRANSLATE(x) ((unsigned)(x) <= 331 ? yytranslate[x] : 167) |
#define | YYLAST 1110 |
#define | YYSTACK_ALLOC malloc |
#define | YYSTACK_FREE free |
#define | YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) |
#define | YYSTACK_BYTES(N) |
#define | YYCOPY(To, From, Count) |
#define | YYSTACK_RELOCATE(Stack) |
#define | YYSIZE_T unsigned int |
#define | yyerrok (yyerrstatus = 0) |
#define | yyclearin (yychar = YYEMPTY) |
#define | YYEMPTY -2 |
#define | YYEOF 0 |
#define | YYACCEPT goto yyacceptlab |
#define | YYABORT goto yyabortlab |
#define | YYERROR goto yyerrlab1 |
#define | YYFAIL goto yyerrlab |
#define | YYRECOVERING() (!!yyerrstatus) |
#define | YYBACKUP(Token, Value) |
#define | YYTERROR 1 |
#define | YYERRCODE 256 |
#define | YYLLOC_DEFAULT(Current, Rhs, N) |
#define | YYLEX yylex () |
#define | YYDPRINTF(Args) |
#define | YYINITDEPTH 200 |
#define | YYMAXDEPTH 10000 |
#define | YYPARSE_PARAM_ARG |
#define | YYPARSE_PARAM_DECL |
#define | YY_DECL_NON_LSP_VARIABLES |
#define | YY_DECL_VARIABLES YY_DECL_NON_LSP_VARIABLES |
#define | YYPOPSTACK (yyvsp--, yyssp--) |
Functions | |
void | yyerror (char *) |
int | yylex () |
static Uc_array_expression * | Create_array (int, Uc_expression *) |
static Uc_array_expression * | Create_array (int, Uc_expression *, Uc_expression *) |
static unsigned int | yystrlen (yystr) const char *yystr |
int | yyparse () |
Variables | |
std::vector< Uc_function * > | functions |
static Uc_function * | function = 0 |
static int | enum_val = -1 |
static const char | yytranslate [] |
static const char *const | yytname [] |
static const short | yyr1 [] |
static const short | yyr2 [] |
static const short | yydefact [] |
static const short | yydefgoto [] |
static const short | yypact [] |
static const short | yypgoto [] |
static const short | yytable [] |
static const short | yycheck [] |
const char * | yysrc |
yystype | yylval |
int | yynerrs |
#define ACTOR 311 |
#define ADD 284 |
#define AFTER 287 |
#define AND 324 |
#define BREAK 266 |
#define CALL 305 |
Definition at line 54 of file ucparse.cc.
#define CASE 268 |
#define CONTINUE 291 |
#define CONVERSE 274 |
#define CYCLE 302 |
#define DESCEND 297 |
#define EAST 314 |
#define ELSE 258 |
#define ENUM 273 |
#define EQUALS 326 |
#define EVENT 278 |
#define EXTERN 265 |
#define FACE 308 |
#define FLAG 279 |
#define FOR 261 |
#define FRAME 298 |
#define GOTO 267 |
#define GTEQUALS 329 |
#define HATCH 299 |
#define HIDE 285 |
#define HIT 309 |
#define HOURS 310 |
#define IDENTIFIER 322 |
#define IF 257 |
#define INT_LITERAL 323 |
#define ITEM 280 |
#define LTEQUALS 328 |
#define MESSAGE 276 |
#define MUSIC 304 |
#define NE 316 |
#define NEQUALS 327 |
#define NEXT 300 |
#define NOHALT 294 |
#define NOP 293 |
#define NORTH 312 |
#define NOT 330 |
#define NW 317 |
#define OR 325 |
#define ORIGINAL 290 |
#define PREVIOUS 301 |
#define REMOVE 283 |
#define REPEAT 292 |
#define RESPONSE 277 |
#define RETURN 259 |
#define RISE 296 |
#define SAY 275 |
#define SCRIPT 286 |
#define SE 318 |
#define SFX 307 |
#define SOUTH 313 |
#define SPEECH 306 |
#define STATIC_ 289 |
#define STEP 303 |
#define STRING 272 |
#define STRING_LITERAL 320 |
#define STRING_PREFIX 321 |
#define SW 319 |
#define TICKS 288 |
#define TO 264 |
#define UCC_CONST 271 |
#define UCC_IN 262 |
#define UCC_INT 270 |
#define UCC_POINTS 331 |
#define UCFALSE 282 |
#define UCTRUE 281 |
#define VAR 269 |
#define WAIT 295 |
#define WEST 315 |
#define WHILE 260 |
#define WITH 263 |
#define YY_DECL_NON_LSP_VARIABLES |
#define YY_DECL_VARIABLES YY_DECL_NON_LSP_VARIABLES |
Referenced by yyparse().
#define YYABORT goto yyabortlab |
#define YYACCEPT goto yyacceptlab |
#define YYBACKUP | ( | Token, | |||
Value | ) |
Value:
do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up"); \ YYERROR; \ } \ while (0)
Definition at line 928 of file ucparse.cc.
#define YYBISON 1 |
Definition at line 4 of file ucparse.cc.
#define yyclearin (yychar = YYEMPTY) |
Definition at line 917 of file ucparse.cc.
#define YYCOPY | ( | To, | |||
From, | |||||
Count | ) |
Value:
do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0)
Definition at line 870 of file ucparse.cc.
#define YYDEBUG 0 |
Definition at line 163 of file ucparse.cc.
#define YYDPRINTF | ( | Args | ) |
#define YYEMPTY -2 |
#define YYEOF 0 |
#define YYERRCODE 256 |
Definition at line 946 of file ucparse.cc.
#define yyerrok (yyerrstatus = 0) |
Definition at line 916 of file ucparse.cc.
#define YYERROR goto yyerrlab1 |
Definition at line 922 of file ucparse.cc.
#define YYERROR_VERBOSE 1 |
Definition at line 134 of file ucparse.cc.
#define YYFAIL goto yyerrlab |
Definition at line 926 of file ucparse.cc.
#define YYFINAL 374 |
#define YYFLAG -32768 |
#define YYINITDEPTH 200 |
#define YYLAST 1110 |
#define YYLEX yylex () |
#define YYLLOC_DEFAULT | ( | Current, | |||
Rhs, | |||||
N | ) |
Value:
Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column;
Definition at line 957 of file ucparse.cc.
Referenced by yyparse().
#define YYMAXDEPTH 10000 |
#define YYNTBASE 97 |
#define YYPARSE_PARAM_ARG |
#define YYPARSE_PARAM_DECL |
#define YYPOPSTACK (yyvsp--, yyssp--) |
#define YYRECOVERING | ( | ) | (!!yyerrstatus) |
Definition at line 927 of file ucparse.cc.
#define YYSIZE_T unsigned int |
#define YYSTACK_ALLOC malloc |
#define YYSTACK_BYTES | ( | N | ) |
Value:
((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAX)
Definition at line 858 of file ucparse.cc.
Referenced by yyparse().
#define YYSTACK_FREE free |
#define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) |
Definition at line 849 of file ucparse.cc.
#define YYSTACK_RELOCATE | ( | Stack | ) |
Value:
do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0)
Definition at line 886 of file ucparse.cc.
Referenced by yyparse().
#define YYSTYPE yystype |
#define YYSTYPE_IS_TRIVIAL 1 |
Definition at line 160 of file ucparse.cc.
#define YYTERROR 1 |
#define YYTRANSLATE | ( | x | ) | ((unsigned)(x) <= 331 ? yytranslate[x] : 167) |
static Uc_array_expression * Create_array | ( | int | , | |
Uc_expression * | , | |||
Uc_expression * | ||||
) | [static] |
Definition at line 2503 of file ucparse.cc.
References Uc_array_expression::add().
Here is the call graph for this function:
static Uc_array_expression * Create_array | ( | int | , | |
Uc_expression * | ||||
) | [static] |
Definition at line 2492 of file ucparse.cc.
References Uc_array_expression::add().
Referenced by yyparse().
Here is the call graph for this function:
void yyerror | ( | char * | ) |
Definition at line 135 of file ucmain.cc.
References Uc_location::yyerror().
Referenced by yyparse().
Here is the call graph for this function:
int yylex | ( | ) |
Definition at line 893 of file uclex.cc.
References ACTOR, ADD, AFTER, AND, BEGIN, BREAK, CALL, CASE, comment, CONTINUE, CONVERSE, CYCLE, DESCEND, EAST, ECHO, ELSE, ENUM, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, EQUALS, EVENT, EXTERN, FACE, FLAG, FOR, FRAME, Uc_location::get_line(), Uc_location::get_source(), GOTO, GTEQUALS, Handle_string(), HATCH, HIDE, HIT, HOURS, IDENTIFIER, IF, Include(), Uc_location::increment_cur_line(), INITIAL, INT_LITERAL, yystype::intval, ITEM, LTEQUALS, MESSAGE, MUSIC, NE, NEQUALS, NEXT, NOHALT, NOP, NORTH, NOT, NW, OR, ORIGINAL, PREVIOUS, REMOVE, REPEAT, RESPONSE, RETURN, RISE, SAY, SCRIPT, SE, Uc_location::set_cur(), Set_location(), SFX, SOUTH, SPEECH, STATIC_, STEP, STRING, STRING_LITERAL, STRING_PREFIX, yystype::strval, SW, TICKS, TO, UCC_CONST, UCC_IN, UCC_INT, UCC_POINTS, UCFALSE, UCTRUE, VAR, WAIT, WEST, WHILE, WITH, yy_bp, YY_BREAK, YY_BUF_SIZE, YY_BUFFER_NEW, YY_BUFFER_NORMAL, yy_buffer_state::yy_buffer_status, yy_c_buf_p, yy_buffer_state::yy_ch_buf, yy_create_buffer(), YY_CURRENT_BUFFER, yy_current_buffer, yy_delete_buffer(), yy_did_buffer_switch_on_eof, YY_DO_BEFORE_ACTION, YY_END_OF_BUFFER, YY_FATAL_ERROR, yy_get_next_buffer(), yy_get_previous_state(), yy_hold_char, yy_init, yy_buffer_state::yy_input_file, yy_load_buffer_state(), YY_MORE_ADJ, yy_buffer_state::yy_n_chars, yy_n_chars, YY_NEW_FILE, YY_RESTORE_YY_MORE_OFFSET, YY_RULE_SETUP, YY_SC_TO_UI, YY_START, yy_start, YY_STATE_EOF, yy_switch_to_buffer(), yy_try_NUL_trans(), Uc_location::yyerror(), yylval, yyout, yyterminate, yytext_ptr, and yywrap().
Referenced by main().
Here is the call graph for this function:
int yyparse | ( | ) |
Definition at line 1139 of file ucparse.cc.
References Uc_array_expression::add(), Uc_block_statement::add(), Uc_function::add_function_symbol(), Uc_function::add_global_function_symbol(), Uc_function::add_global_int_const_symbol(), Uc_function::add_global_static(), Uc_function::add_int_const_symbol(), Uc_function::add_label(), Uc_function::add_static(), Uc_function::add_string(), Uc_function::add_string_symbol(), Uc_function::add_symbol(), Uc_array_expression::concat(), Ucscript::cont, Create_array(), Ucscript::delay_hours, Ucscript::delay_ticks, Ucscript::descend, Ucscript::dont_halt, Ucscript::egg, enum_val, Ucscript::face_dir, Ucscript::frame, function, functions, Uc_function::get_add_answer(), Uc_array_expression::get_exprs(), Uc_function::get_intrinsic(), Uc_function::get_remove_answer(), Uc_function::get_remove_face(), Uc_function::get_show_face(), Uc_const_int_symbol::get_value(), Ucscript::hit, Ucscript::music, Ucscript::next_frame, Ucscript::next_frame_max, Ucscript::nop, Uc_function::pop_scope(), Ucscript::prev_frame, Ucscript::prev_frame_min, Uc_function::push_scope(), Ucscript::remove, Ucscript::repeat, Ucscript::rise, Ucscript::say, Uc_function::search_label(), Uc_function::search_up(), Uc_function::set_statement(), Ucscript::sfx, Ucscript::speech, Ucscript::step, Ucscript::step_n, UC_ADD, UC_AND, UC_ARRA, UC_CMPEQ, UC_CMPG, UC_CMPGE, UC_CMPL, UC_CMPLE, UC_CMPNE, UC_DIV, UC_IN, UC_MOD, UC_MUL, UC_NOT, UC_OR, UC_SUB, Ucscript::usecode, Ucscript::usecode2, YY_DECL_VARIABLES, YYABORT, YYACCEPT, yycheck, yydefact, yydefgoto, YYDPRINTF, YYEMPTY, YYEOF, yyerror(), YYFINAL, YYFLAG, YYINITDEPTH, YYLAST, YYLEX, YYLLOC_DEFAULT, yylval, YYMAXDEPTH, yynerrs, YYNTBASE, yypact, yypgoto, yyr1, yyr2, YYSIZE_T, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, yystrlen(), YYSTYPE, yytable, YYTERROR, yytname, and YYTRANSLATE.
Referenced by main().
Here is the call graph for this function:
static unsigned int yystrlen | ( | yystr | ) | const [static] |
Referenced by yyparse().
int enum_val = -1 [static] |
Uc_function* function = 0 [static] |
Definition at line 138 of file ucparse.cc.
Referenced by Uc_call_expression::gen_value(), and yyparse().
std::vector<Uc_function *> functions |
Definition at line 136 of file ucparse.cc.
const short yycheck[] [static] |
const short yydefact[] [static] |
const short yydefgoto[] [static] |
Initial value:
{ 6, 7, 8, 20, 9, 34, 124, 43, 73, 125, 126, 187, 127, 26, 69, 70, 128, 24, 71, 188, 129, 28, 29, 190, 191, 130, 131, 132, 133, 134, 272, 273, 361, 135, 136, 137, 138, 139, 140, 141, 324, 353, 367, 142, 198, 317, 271, 308, 358, 228, 143, 144, 145, 146, 147, 209, 210, 60, 61, 62, 103, 63, 80, 74, 75, 35, 14, 64, 65, 66 }
Definition at line 463 of file ucparse.cc.
Referenced by yyparse().
int yynerrs |
const short yypact[] [static] |
const short yypgoto[] [static] |
Initial value:
{ -32768, 307,-32768,-32768, 313,-32768, 296,-32768, -50, -109, -32768,-32768, 61,-32768,-32768, 217, 64,-32768, 39, 108, 73,-32768, 280,-32768, 106, 83,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768, -246,-32768,-32768,-32768, -32768,-32768,-32768,-32768, 66, -178, -51, -55, -70,-32768, 189, -95,-32768,-32768,-32768, -73, -40,-32768, 110, -19 }
Definition at line 516 of file ucparse.cc.
Referenced by yyparse().
const short yyr1[] [static] |
Initial value:
{ 0, 97, 97, 98, 98, 98, 98, 98, 100, 99, 101, 102, 102, 104, 103, 105, 105, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 107, 107, 107, 107, 107, 107, 108, 108, 110, 109, 111, 111, 112, 112, 113, 114, 114, 115, 116, 116, 117, 118, 118, 119, 120, 120, 121, 122, 123, 124, 124, 125, 126, 127, 126, 128, 129, 126, 130, 131, 132, 133, 133, 134, 134, 135, 136, 137, 137, 138, 139, 139, 140, 141, 142, 142, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 144, 144, 144, 144, 144, 144, 144, 144, 145, 146, 146, 147, 148, 149, 150, 150, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 152, 152, 153, 153, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 155, 155, 156, 157, 157, 158, 159, 159, 160, 160, 161, 161, 162, 162, 163, 163, 164, 165, 166 }
Definition at line 371 of file ucparse.cc.
Referenced by yyparse().
const short yyr2[] [static] |
Initial value:
{ 0, 2, 1, 1, 1, 1, 1, 1, 0, 3, 6, 1, 0, 0, 4, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 1, 1, 3, 3, 1, 1, 1, 1, 3, 1, 0, 7, 3, 1, 1, 1, 4, 3, 1, 3, 1, 3, 4, 1, 3, 1, 3, 1, 3, 3, 4, 5, 7, 5, 3, 0, 6, 0, 0, 9, 4, 2, 2, 7, 6, 3, 2, 2, 7, 2, 0, 5, 3, 0, 4, 1, 2, 1, 2, 4, 2, 2, 3, 4, 2, 2, 2, 3, 4, 2, 3, 4, 3, 4, 3, 3, 3, 3, 3, 5, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 0, 2, 2, 2, 5, 5, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 1, 1, 1, 0, 3, 1, 1, 1, 4, 4, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 5, 1, 0, 1, 0, 4, 2, 1, 1, 1, 0, 1, 1, 1 }
Definition at line 395 of file ucparse.cc.
Referenced by yyparse().
const char* yysrc |
Definition at line 1060 of file ucparse.cc.
const short yytable[] [static] |
const char* const yytname[] [static] |
const char yytranslate[] [static] |
Definition at line 176 of file ucparse.cc.