#include <stdio.h>#include <fcntl.h>#include <unistd.h>#include <fstream>#include <string>#include <list>#include "YCP.h"#include "ycp/Scanner.h"#include "ycp/y2log.h"#include "ycp/pathsearch.h"#include "ycp/ExecutionEnvironment.h"#include "ycp/StaticDeclaration.h"#include "ycp/YCode.h"#include "ycp/Type.h"#include "ycp/YExpression.h"#include "ycp/YStatement.h"#include "ycp/YBlock.h"#include "ycp/SymbolTable.h"#include "ycp/YSymbolEntry.h"#include "ycp/Point.h"#include "ycp/Bytecode.h"#include "ycp/Parser.h"Defines | |
| #define | YYBISON 1 |
| #define | YYSKELETON_NAME "yacc.c" |
| #define | YYPURE 1 |
| #define | YYLSP_NEEDED 0 |
| #define | SCANNER_ERROR 258 |
| #define | END_OF_FILE 259 |
| #define | EMPTY 260 |
| #define | LIST 261 |
| #define | MAP 262 |
| #define | STRUCT 263 |
| #define | BLOCK 264 |
| #define | DEFINE 265 |
| #define | UNDEFINE 266 |
| #define | I18N 267 |
| #define | RETURN 268 |
| #define | CONTINUE 269 |
| #define | BREAK 270 |
| #define | IF 271 |
| #define | DO 272 |
| #define | WHILE 273 |
| #define | REPEAT 274 |
| #define | UNTIL 275 |
| #define | IS 276 |
| #define | ISNIL 277 |
| #define | SYMBOL 278 |
| #define | DCSYMBOL 279 |
| #define | DCQUOTED_BLOCK 280 |
| #define | QUOTED_BLOCK 281 |
| #define | QUOTED_EXPRESSION 282 |
| #define | CLOSEBRACKET 283 |
| #define | TYPEDEF 284 |
| #define | MODULE 285 |
| #define | IMPORT 286 |
| #define | EXPORT 287 |
| #define | MAPEXPR 288 |
| #define | INCLUDE 289 |
| #define | GLOBAL 290 |
| #define | TEXTDOMAIN 291 |
| #define | CONST 292 |
| #define | FULLNAME 293 |
| #define | STATIC 294 |
| #define | EXTERN 295 |
| #define | LOOKUP 296 |
| #define | SELECT 297 |
| #define | SYM_NAMESPACE 298 |
| #define | IDENTIFIER 299 |
| #define | STRING 300 |
| #define | C_VOID 301 |
| #define | C_BOOLEAN 302 |
| #define | C_INTEGER 303 |
| #define | C_FLOAT 304 |
| #define | C_BYTEBLOCK 305 |
| #define | C_PATH 306 |
| #define | C_SYMBOL 307 |
| #define | C_TYPE 308 |
| #define | OR 309 |
| #define | AND 310 |
| #define | NEQ 311 |
| #define | EQUALS 312 |
| #define | GE 313 |
| #define | LE 314 |
| #define | RIGHT 315 |
| #define | LEFT 316 |
| #define | ELSE 317 |
| #define | UMINUS 318 |
| #define | DO_DEBUG 0 |
| #define | YYDEBUG 0 |
| #define | YYERROR_VERBOSE 1 |
| #define | YYINITDEPTH 1000 |
| #define | YYMAXDEPTH 50000 |
| #define | YYSTYPE yystype_type |
| #define | YYPARSE_PARAM vp_parser |
| #define | YYLEX_PARAM vp_parser |
| #define | p_parser ((Parser *) vp_parser) |
| #define | LINE_NOW (p_parser->m_lineno) |
| #define | FILE_NOW (p_parser->scanner()->filename ()) |
| #define | yyerror(text) yyerror_with_lineinfo (p_parser, -1, text) |
| #define | yywarning(text, lineno) yywarning_with_lineinfo (p_parser, lineno, text) |
| #define | yyConstAssignError(name, lineno) yyerror_assign_const (p_parser, lineno, name) |
| #define | yyLerror(text, lineno) yyerror_with_lineinfo (p_parser, lineno, text) |
| #define | yyCerror(code, type, lineno) yyerror_with_code (p_parser, lineno, code, type) |
| #define | yyVerror(name, lineno) yyerror_with_name (p_parser, lineno, name) |
| #define | yyFerror(name, lineno) yyerror_with_file (p_parser, lineno, name) |
| #define | yyTerror(text, lineno, tentry) yyerror_with_tableentry (p_parser, lineno, text, tentry) |
| #define | yyTwarning(tentry) yywarning_with_tableentry (p_parser, 0, tentry) |
| #define | yyTypeMismatch(text, expected, seen, lineno) yyerror_type_mismatch (p_parser, lineno, text, expected, seen) |
| #define | yyMissingArgument(type, lineno) yyerror_missing_argument (p_parser, lineno, type) |
| #define | yyCantCast(from, to, lineno) yyerror_cant_cast (p_parser, lineno, from, to) |
| #define | yyNoModule(module, lineno) yyerror_no_module (p_parser, lineno, module) |
| #define | check_unary_op(result, e1, op) i_check_unary_op (result, e1, op, p_parser) |
| #define | check_binary_op(result, e1, op, e2) i_check_binary_op (result, e1, op, e2, p_parser) |
| #define | check_compare_op(result, e1, op, e2) i_check_compare_op (result, e1, op, e2, p_parser) |
| #define | check_void_assign(lhs, rhs) i_check_void_assign (lhs, rhs, p_parser) |
| #define | blockstack_push(s, e) stack_push ((stack_t **)&(s), (stack_t *)e) |
| #define | blockstack_pop(s) (p_parser->m_blockstack_depth--, (blockstack_t *)stack_pop ((stack_t **)&(s))) |
| #define | blockstack_at_toplevel() (p_parser->m_blockstack_depth == 1) |
| #define | scannerstack_push(s, e) stack_push ((stack_t **)&(s), (stack_t *)e) |
| #define | scannerstack_pop(s) (scannerstack_t *)stack_pop ((stack_t **)&(s)) |
| #define | scannerstack_empty() (p_parser->m_scanner_stack == 0) |
| #define | YYERROR_VERBOSE 1 |
| #define | YYSTACK_ALLOC malloc |
| #define | YYSTACK_FREE free |
| #define | YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
| #define | YYSTACK_BYTES(N) |
| #define | YYCOPY(To, From, Count) |
| #define | YYSTACK_RELOCATE(Stack) |
| #define | YYFINAL 54 |
| #define | YYLAST 1215 |
| #define | YYNTOKENS 87 |
| #define | YYNNTS 46 |
| #define | YYNRULES 149 |
| #define | YYNSTATES 296 |
| #define | YYUNDEFTOK 2 |
| #define | YYMAXUTOK 318 |
| #define | YYTRANSLATE(YYX) ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
| #define | YYPACT_NINF -239 |
| #define | YYTABLE_NINF -146 |
| #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 (&yylval, YYLEX_PARAM) |
| #define | YYDPRINTF(Args) |
| #define | YYDSYMPRINT(Args) |
| #define | YYDSYMPRINTF(Title, Token, Value, Location) |
| #define | YY_STACK_PRINT(Bottom, Top) |
| #define | YY_REDUCE_PRINT(Rule) |
| #define | YYPOPSTACK (yyvsp--, yyssp--) |
Typedefs | |
| typedef stack | stack_t |
| general stack handling | |
| typedef short | yysigned_char |
Enumerations | |
| enum | yytokentype { SCANNER_ERROR = 258, END_OF_FILE = 259, EMPTY = 260, LIST = 261, MAP = 262, STRUCT = 263, BLOCK = 264, DEFINE = 265, UNDEFINE = 266, I18N = 267, RETURN = 268, CONTINUE = 269, BREAK = 270, IF = 271, DO = 272, WHILE = 273, REPEAT = 274, UNTIL = 275, IS = 276, ISNIL = 277, SYMBOL = 278, DCSYMBOL = 279, DCQUOTED_BLOCK = 280, QUOTED_BLOCK = 281, QUOTED_EXPRESSION = 282, CLOSEBRACKET = 283, TYPEDEF = 284, MODULE = 285, IMPORT = 286, EXPORT = 287, MAPEXPR = 288, INCLUDE = 289, GLOBAL = 290, TEXTDOMAIN = 291, CONST = 292, FULLNAME = 293, STATIC = 294, EXTERN = 295, LOOKUP = 296, SELECT = 297, SYM_NAMESPACE = 298, IDENTIFIER = 299, STRING = 300, C_VOID = 301, C_BOOLEAN = 302, C_INTEGER = 303, C_FLOAT = 304, C_BYTEBLOCK = 305, C_PATH = 306, C_SYMBOL = 307, C_TYPE = 308, OR = 309, AND = 310, NEQ = 311, EQUALS = 312, GE = 313, LE = 314, RIGHT = 315, LEFT = 316, ELSE = 317, UMINUS = 318 } |
| enum | scan_states { SCAN_FILE, SCAN_START_INCLUDE, SCAN_INCLUDE } |
Functions | |
| static void | yyerror_with_lineinfo (Parser *parser, int lineno, const char *s) |
| static void | yywarning_with_lineinfo (Parser *parser, int lineno, const char *s) |
| static void | yyerror_with_code (Parser *parser, int lineno, YCodePtr c, constTypePtr t) |
| static void | yyerror_with_name (Parser *parser, int lineno, const char *s) |
| static void | yyerror_with_file (Parser *parser, int lineno, const char *s) |
| static void | yyerror_with_tableentry (Parser *parser, int lineno, const char *s, TableEntry *entry) |
| static void | yywarning_with_tableentry (Parser *parser, int lineno, TableEntry *entry) |
| static void | yyerror_type_mismatch (Parser *parser, int lineno, const char *s, constTypePtr expected_type, constTypePtr seen_type) |
| static void | yyerror_missing_argument (Parser *parser, int lineno, constTypePtr type) |
| static void | yyerror_assign_const (Parser *parser, int lineno, const char *s) |
| static void | yyerror_cant_cast (Parser *parser, int lineno, constTypePtr from, constTypePtr to) |
| static void | yyerror_no_module (Parser *parser, int lineno, const char *module) |
| static constTypePtr | attach_parameter (Parser *parser, YCodePtr code, YYSTYPE *parm, YYSTYPE *parm1=0) |
| static YBlockPtr | start_block (Parser *parser, constTypePtr type) |
| int | yylex (YYSTYPE *, void *) |
| static void | i_check_unary_op (YYSTYPE *result, YYSTYPE *e1, const char *op, Parser *parser) |
| static void | i_check_binary_op (YYSTYPE *result, YYSTYPE *e1, const char *op, YYSTYPE *e2, Parser *parser) |
| static void | i_check_compare_op (YYSTYPE *result, YYSTYPE *e1, YECompare::c_op op, YYSTYPE *e2, Parser *parser) |
| static void | i_check_void_assign (YYSTYPE *lhs, YYSTYPE *rhs, Parser *parser) |
| static void | stack_push (stack_t **stack, stack_t *element) |
| push element to stack | |
| static stack_t * | stack_pop (stack_t **stack) |
| pop element to stack | |
| static YYSIZE_T | yystrlen (yystr) const char *yystr |
| int | yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM |
Variables | |
| static constTypePtr | declared_return_type = Type::Unspec |
| set by function declaration in order to predefine a definitions block return type | |
| static constTypePtr | found_return_type = Type::Unspec |
| set when a return statement is encountered | |
| StaticDeclaration | static_declarations |
| ExecutionEnvironment | ee |
| static bool | inside_module = false |
| static int | repeat_count = 0 |
| static int | do_while_count = 0 |
| static const unsigned char | yytranslate [] |
| static const char *const | yytname [] |
| static const unsigned char | yyr1 [] |
| static const unsigned char | yyr2 [] |
| static const unsigned char | yydefact [] |
| static const short | yydefgoto [] |
| static const short | yypact [] |
| static const short | yypgoto [] |
| static const short | yytable [] |
| static const short | yycheck [] |
| static const unsigned char | yystos [] |
| const char * | yysrc |
| YYSTYPE * | yyvaluep |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Value: do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Value: do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Value: Current.first_line = Rhs[1].first_line; \ Current.first_column = Rhs[1].first_column; \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Value: ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) |
|
|
|
|
|
|
|
|
Value: do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
general stack handling
|
|
|
|
|
|
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
pop element to stack
|
|
||||||||||||
|
push element to stack
|
|
||||||||||||
|
begin of a block
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
set by function declaration in order to predefine a definitions block return type
|
|
|
|
|
|
|
|
|
set when a return statement is encountered
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initial value:
{
-1, 23, 50, 40, 206, 41, 42, 43, 25, 53,
34, 59, 60, 123, 233, 124, 277, 176, 257, 178,
259, 284, 198, 199, 204, 125, 126, 127, 128, 193,
236, 237, 238, 129, 26, 27, 51, 93, 28, 46,
29, 100, 168, 30, 31, 183
}
|
|
|
|
|
|
Initial value:
{
-239, -239, -6, 62, -239, 63, 4, -239, -39, -239,
-239, -48, -239, -238, -239, -239, -239, -239, -239, -239,
-239, -239, -4, -128, -239, -239, -239, -239, -239, -239,
-239, -239, -64, -239, -239, -239, -83, 156, -239, -239,
-57, -239, -239, -239, -58, -20
}
|
|
|
Initial value:
{
0, 87, 88, 88, 88, 89, 89, 89, 89, 90,
91, 91, 91, 91, 92, 93, 93, 93, 93, 93,
93, 93, 93, 93, 93, 93, 93, 93, 93, 94,
94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
94, 96, 95, 97, 95, 98, 99, 99, 100, 101,
100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 102, 103, 102, 104, 105, 102, 106,
107, 102, 102, 102, 102, 102, 108, 108, 109, 109,
109, 109, 109, 109, 109, 109, 109, 109, 110, 110,
111, 111, 112, 112, 112, 112, 113, 114, 115, 115,
116, 116, 117, 117, 118, 118, 119, 120, 120, 121,
121, 121, 121, 121, 121, 121, 121, 122, 122, 123,
123, 124, 124, 125, 125, 126, 126, 128, 127, 129,
129, 129, 129, 129, 130, 130, 131, 131, 132, 132
}
|
|
|
Initial value:
{
0, 2, 1, 1, 0, 1, 1, 1, 1, 5,
0, 1, 1, 1, 4, 1, 8, 8, 1, 3,
3, 6, 1, 7, 3, 1, 1, 1, 1, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
5, 0, 3, 0, 3, 2, 2, 0, 1, 0,
4, 3, 3, 3, 3, 3, 3, 4, 1, 2,
2, 1, 1, 6, 0, 6, 0, 0, 9, 0,
0, 9, 2, 2, 2, 3, 2, 0, 1, 1,
3, 1, 5, 3, 2, 2, 3, 4, 2, 2,
1, 3, 4, 2, 2, 4, 4, 4, 1, 0,
1, 0, 0, 1, 1, 3, 2, 3, 6, 1,
1, 1, 1, 1, 1, 1, 1, 2, 4, 1,
3, 1, 0, 2, 4, 3, 5, 0, 5, 0,
2, 1, 4, 3, 1, 1, 1, 1, 1, 3
}
|
|
|
|
|
|
|
|
|
|
|
|
Initial value:
{
"$end", "error", "$undefined", "SCANNER_ERROR", "END_OF_FILE", "EMPTY",
"LIST", "MAP", "STRUCT", "BLOCK", "DEFINE", "UNDEFINE", "I18N",
"RETURN", "CONTINUE", "BREAK", "IF", "DO", "WHILE", "REPEAT", "UNTIL",
"IS", "ISNIL", "SYMBOL", "DCSYMBOL", "DCQUOTED_BLOCK", "QUOTED_BLOCK",
"QUOTED_EXPRESSION", "CLOSEBRACKET", "TYPEDEF", "MODULE", "IMPORT",
"EXPORT", "MAPEXPR", "INCLUDE", "GLOBAL", "TEXTDOMAIN", "CONST",
"FULLNAME", "STATIC", "EXTERN", "LOOKUP", "SELECT", "SYM_NAMESPACE",
"IDENTIFIER", "STRING", "C_VOID", "C_BOOLEAN", "C_INTEGER", "C_FLOAT",
"C_BYTEBLOCK", "C_PATH", "C_SYMBOL", "C_TYPE", "'='", "'?'", "OR",
"AND", "'|'", "'^'", "'&'", "NEQ", "EQUALS", "'<'", "'>'", "GE", "LE",
"RIGHT", "LEFT", "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "ELSE",
"'~'", "UMINUS", "':'", "'['", "'('", "')'", "','", "'{'", "'}'", "';'",
"']'", "$accept", "ycp", "expression", "bracket_expression",
"castable_expression", "casted_expression", "compact_expression",
"infix_expression", "block", "@1", "@2", "block_end", "statements",
"statement", "@3", "control_statement", "@4", "@5", "@6", "@7", "@8",
"opt_else", "type", "type_gt", "types", "definition", "function_start",
"opt_global_identifier", "opt_global", "opt_define", "tupletypes",
"tupletype", "formal_param", "assignment", "constant", "list",
"list_elements", "opt_comma", "map", "map_elements", "function_call",
"@9", "parameters", "function_name", "identifier", "identifier_list", 0
}
|
|
|
|
|
|
|
1.4.1