pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:332:   %type <n> expr_list   %type <n> expr_list2   %type <n> for   %type <n> for_expr   %type <n> foreach   %type <n> gauge   %type <n> idents   %type <n> idents2   %type <n> labeled_statement   %type <n> lambda + %type <n> literal_expr   %type <n> local_name_list   %type <n> low_idents   %type <n> safe_lvalue   %type <n> lvalue   %type <n> lvalue_list   %type <n> low_lvalue_list   %type <n> m_expr_list   %type <n> m_expr_list2   %type <n> new_local_name   %type <n> normal_label_statement
pike.git/src/language.yacc:3489:    }    ;      implicit_modifiers:    {    $$ = Pike_compiler->current_modifiers = ID_PROTECTED|ID_INLINE|ID_PRIVATE |    (THIS_COMPILATION->lex.pragmas & ID_MODIFIER_MASK);    }    ;    - expr4: string -  | TOK_NUMBER -  | TOK_FLOAT { $$=mkfloatnode((FLOAT_TYPE)$1); } + expr4: literal_expr    | catch    | gauge    | typeof    | sscanf    | lambda    | implicit_modifiers class { $$ = $2; }    | implicit_modifiers enum { $$ = $2; }    | idents2    | apply    | expr4 open_bracket_with_line_info '*' ']'
pike.git/src/language.yacc:3608:    | expr4 open_bracket_with_line_info error ')'    {$$=$1; yyerror("Missing ']'."); free_node ($2);}    | open_paren_with_line_info comma_expr2 ')'    {    $$=$2;    if ($$) {    COPY_LINE_NUMBER_INFO($$, $1);    }    free_node ($1);    } -  | open_paren_with_line_info '{' expr_list close_brace_or_missing ')' -  { -  /* FIXME: May eat lots of stack; cf Standards.FIPS10_4.divisions */ -  $$=mkefuncallnode("aggregate",$3); -  COPY_LINE_NUMBER_INFO($$, $1); -  free_node ($1); -  } -  | open_paren_with_line_info -  open_bracket_with_line_info /* Only to avoid shift/reduce conflicts. */ -  m_expr_list close_bracket_or_missing ')' -  { -  /* FIXME: May eat lots of stack; cf Standards.FIPS10_4.divisions */ -  $$=mkefuncallnode("aggregate_mapping",$3); -  COPY_LINE_NUMBER_INFO($$, $1); -  free_node ($1); -  free_node ($2); -  } -  | TOK_MULTISET_START line_number_info expr_list TOK_MULTISET_END -  { -  /* FIXME: May eat lots of stack; cf Standards.FIPS10_4.divisions */ -  $$=mkefuncallnode("aggregate_multiset",$3); -  COPY_LINE_NUMBER_INFO($$, $2); -  free_node ($2); -  } -  | TOK_MULTISET_START line_number_info expr_list ')' -  { -  yyerror("Missing '>'."); -  $$=mkefuncallnode("aggregate_multiset",$3); -  COPY_LINE_NUMBER_INFO($$, $2); -  free_node ($2); -  } +     | open_paren_with_line_info error ')' { $$=$1; yyerrok; }    | open_paren_with_line_info error TOK_LEX_EOF    {    $$=$1; yyerror("Missing ')'.");    yyerror("Unexpected end of file.");    }    | open_paren_with_line_info error ';' { $$=$1; yyerror("Missing ')'."); }    | open_paren_with_line_info error '}' { $$=$1; yyerror("Missing ')'."); } -  | TOK_MULTISET_START line_number_info error TOK_MULTISET_END { $$=$2; yyerrok; } -  | TOK_MULTISET_START line_number_info error ')' { -  yyerror("Missing '>'."); -  $$=$2; yyerrok; -  } -  | TOK_MULTISET_START line_number_info error TOK_LEX_EOF -  { -  $$=$2; yyerror("Missing '>)'."); -  yyerror("Unexpected end of file."); -  } -  | TOK_MULTISET_START line_number_info error ';' { $$=$2; yyerror("Missing '>)'."); } -  | TOK_MULTISET_START line_number_info error '}' { $$=$2; yyerror("Missing '>)'."); } +     | expr4 TOK_ARROW line_number_info magic_identifier    {    $$=mknode(F_ARROW,$1,$4);    COPY_LINE_NUMBER_INFO($$, $3);    free_node ($3);    }    | expr4 TOK_SAFE_INDEX line_number_info TOK_IDENTIFIER    {    /* A?->B to ((tmp=A) && tmp->B) */    int temporary;
pike.git/src/language.yacc:3780:    }       free_node($3);    }    | TOK_LOCAL_ID TOK_COLON_COLON bad_identifier    {    $$=0;    }    ;    + literal_expr: string +  | TOK_NUMBER +  | TOK_FLOAT { $$=mkfloatnode((FLOAT_TYPE)$1); } +  | open_paren_with_line_info '{' expr_list close_brace_or_missing ')' +  { +  /* FIXME: May eat lots of stack; cf Standards.FIPS10_4.divisions */ +  $$=mkefuncallnode("aggregate",$3); +  COPY_LINE_NUMBER_INFO($$, $1); +  free_node ($1); +  } +  | open_paren_with_line_info +  open_bracket_with_line_info /* Only to avoid shift/reduce conflicts. */ +  m_expr_list close_bracket_or_missing ')' +  { +  /* FIXME: May eat lots of stack; cf Standards.FIPS10_4.divisions */ +  $$=mkefuncallnode("aggregate_mapping",$3); +  COPY_LINE_NUMBER_INFO($$, $1); +  free_node ($1); +  free_node ($2); +  } +  | TOK_MULTISET_START line_number_info expr_list TOK_MULTISET_END +  { +  /* FIXME: May eat lots of stack; cf Standards.FIPS10_4.divisions */ +  $$=mkefuncallnode("aggregate_multiset",$3); +  COPY_LINE_NUMBER_INFO($$, $2); +  free_node ($2); +  } +  | TOK_MULTISET_START line_number_info expr_list ')' +  { +  yyerror("Missing '>'."); +  $$=mkefuncallnode("aggregate_multiset",$3); +  COPY_LINE_NUMBER_INFO($$, $2); +  free_node ($2); +  } +  | TOK_MULTISET_START line_number_info error TOK_MULTISET_END { $$=$2; yyerrok; } +  | TOK_MULTISET_START line_number_info error ')' { +  yyerror("Missing '>'."); +  $$=$2; yyerrok; +  } +  | TOK_MULTISET_START line_number_info error TOK_LEX_EOF +  { +  $$=$2; yyerror("Missing '>)'."); +  yyerror("Unexpected end of file."); +  } +  | TOK_MULTISET_START line_number_info error ';' { $$=$2; yyerror("Missing '>)'."); } +  | TOK_MULTISET_START line_number_info error '}' { $$=$2; yyerror("Missing '>)'."); } +  ; +    idents: low_idents    | idents '.' TOK_IDENTIFIER    {    $$=index_node($1, Pike_compiler->last_identifier?Pike_compiler->last_identifier->str:NULL,    $3->u.sval.u.string);    free_node($1);    if(Pike_compiler->last_identifier) free_string(Pike_compiler->last_identifier);    copy_shared_string(Pike_compiler->last_identifier, $3->u.sval.u.string);    free_node($3);    }