pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:67:   %token TOK_EXTERN "extern"   %token TOK_FLOAT_ID "float"   %token TOK_FOR "for"   %token TOK_FUNCTION_ID "function"   %token TOK_GAUGE "gauge"   %token TOK_GLOBAL "global"   %token TOK_IDENTIFIER "identifier"   %token TOK_RESERVED "reserved identifier"   %token TOK_IF "if"   %token TOK_IMPORT "import" + %token TOK_IMPLEMENTS "implements"   %token TOK_INHERIT "inherit"   %token TOK_INLINE "inline"   %token TOK_LOCAL_ID "local"   %token TOK_FINAL_ID "final"   %token TOK_FUNCTION_NAME "__func__"   %token TOK_INT_ID "int"   %token TOK_LAMBDA "lambda"   %token TOK_MULTISET_ID "multiset"   %token TOK_MULTISET_END ">)"   %token TOK_MULTISET_START "(<"
pike.git/src/language.yacc:512:    }    | modifiers TOK_INHERIT error ';' { yyerrok; }    | modifiers TOK_INHERIT error TOK_LEX_EOF    {    yyerror("Missing ';'.");    yyerror("Unexpected end of file.");    }    | modifiers TOK_INHERIT error '}' { yyerror("Missing ';'."); }    ;    + implements: modifiers TOK_IMPLEMENTS inherit_ref ';' +  { +  if ($1 && (Pike_compiler->compiler_pass == COMPILER_PASS_FIRST)) { +  yywarning("Modifiers ignored for implements."); +  } +  if($3) { +  compiler_do_implements($3); +  } +  pop_stack(); +  if ($3) free_node($3); +  } +  | modifiers TOK_IMPLEMENTS inherit_ref error ';' +  { +  if ($3) free_node($3); +  pop_stack(); +  yyerrok; +  } +  | modifiers TOK_IMPLEMENTS inherit_ref error TOK_LEX_EOF +  { +  if ($3) free_node($3); +  pop_stack(); +  yyerror("Missing ';'."); +  yyerror("Unexpected end of file."); +  } +  | modifiers TOK_IMPLEMENTS inherit_ref error '}' +  { +  if ($3) free_node($3); +  pop_stack(); +  yyerror("Missing ';'."); +  } +  | modifiers TOK_IMPLEMENTS error ';' { yyerrok; } +  | modifiers TOK_IMPLEMENTS error TOK_LEX_EOF +  { +  yyerror("Missing ';'."); +  yyerror("Unexpected end of file."); +  } +  | modifiers TOK_IMPLEMENTS error '}' +  { +  yyerror("Missing ';'."); +  } +  ; +    import: TOK_IMPORT idents ';'    {    resolv_constant($2);    free_node($2);    use_module(Pike_sp-1);    pop_stack();    }    | TOK_IMPORT string ';'    {    if (call_handle_import($2->u.sval.u.string)) {
pike.git/src/language.yacc:1009:    | modifiers optional_attributes simple_type optional_constant bad_identifier    {    compiler_discard_type();    }    '(' arguments ')' block_or_semi    {    if ($10) free_node($10);    }    | modifiers optional_attributes simple_type optional_constant name_list ';'    | inheritance {} +  | implements {}    | import {}    | constant {}    | modifiers named_class { free_node($2); }    | modifiers enum { free_node($2); }    | typedef {}    | static_assertion expected_semicolon {}    | error TOK_LEX_EOF    {    reset_type_stack();    yyerror("Missing ';'.");
pike.git/src/language.yacc:1191:    | TOK_CATCH { $$ = "catch"; }    | TOK_GAUGE { $$ = "gauge"; }    | TOK_CLASS { $$ = "class"; }    | TOK_BREAK { $$ = "break"; }    | TOK_CASE { $$ = "case"; }    | TOK_CONSTANT { $$ = "constant"; }    | TOK_CONTINUE { $$ = "continue"; }    | TOK_DEFAULT { $$ = "default"; }    | TOK_IMPORT { $$ = "import"; }    | TOK_INHERIT { $$ = "inherit"; } +  | TOK_IMPLEMENTS { $$ = "implements"; }    | TOK_LAMBDA { $$ = "lambda"; }    | TOK_PREDEF { $$ = "predef"; }    | TOK_RETURN { $$ = "return"; }    | TOK_SSCANF { $$ = "sscanf"; }    | TOK_SWITCH { $$ = "switch"; }    | TOK_TYPEOF { $$ = "typeof"; }    | TOK_GLOBAL { $$ = "global"; }    ;      magic_identifiers: magic_identifiers1 | magic_identifiers2 | magic_identifiers3 ;
pike.git/src/language.yacc:4544:    | TOK_EXTERN    { yyerror_reserved("extern"); }    | TOK_FINAL_ID    { yyerror_reserved("final");}    | TOK_ELSE    { yyerror("else without if."); }    | TOK_IMPORT    { yyerror_reserved("import"); }    | TOK_INHERIT    { yyerror_reserved("inherit"); } +  | TOK_IMPLEMENTS +  { yyerror_reserved("implements"); }    ;      /*    * Kludge for bison 1.50.    *    * Bison 1.50 doesn't support having multiple action blocks    * in a sequence where a block refers to the value of its    * immediate predecessor.    */