X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/d42fe46ec330a0b202b28c2af4c8171a627ab531..ab96bb245789d1c24a68d637d48ffab889be3152:/tests/existing.at diff --git a/tests/existing.at b/tests/existing.at index 1b6fa4d1..b912f08a 100644 --- a/tests/existing.at +++ b/tests/existing.at @@ -1,6 +1,6 @@ # Exercising Bison on actual grammars. -*- Autotest -*- -# Copyright (C) 1989-1992, 2000-2005, 2007, 2009-2012 Free Software +# Copyright (C) 1989-1992, 2000-2005, 2007, 2009-2014 Free Software # Foundation, Inc. # This program is free software: you can redistribute it and/or modify @@ -115,281 +115,281 @@ AT_TEST_EXISTING_GRAMMAR([[GNU AWK 3.1.0 Grammar]], ]], [[ start - : opt_nls program opt_nls - ; + : opt_nls program opt_nls + ; program - : rule - | program rule - | error - | program error - | /* empty */ - ; + : rule + | program rule + | error + | program error + | /* empty */ + ; rule - : LEX_BEGIN {} action - | LEX_END {} action - | LEX_BEGIN statement_term - | LEX_END statement_term - | pattern action - | action - | pattern statement_term - | function_prologue function_body - ; + : LEX_BEGIN {} action + | LEX_END {} action + | LEX_BEGIN statement_term + | LEX_END statement_term + | pattern action + | action + | pattern statement_term + | function_prologue function_body + ; func_name - : NAME - | FUNC_CALL - | lex_builtin - ; + : NAME + | FUNC_CALL + | lex_builtin + ; lex_builtin - : LEX_BUILTIN - | LEX_LENGTH - ; + : LEX_BUILTIN + | LEX_LENGTH + ; function_prologue - : LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls - ; + : LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls + ; function_body - : l_brace statements r_brace opt_semi opt_nls - | l_brace r_brace opt_semi opt_nls - ; + : l_brace statements r_brace opt_semi opt_nls + | l_brace r_brace opt_semi opt_nls + ; pattern - : exp - | exp ',' exp - ; + : exp + | exp ',' exp + ; regexp - /* - * In this rule, want_regexp tells yylex that the next thing - * is a regexp so it should read up to the closing slash. - */ - : '/' {} REGEXP '/' - ; + /* + * In this rule, want_regexp tells yylex that the next thing + * is a regexp so it should read up to the closing slash. + */ + : '/' {} REGEXP '/' + ; action - : l_brace statements r_brace opt_semi opt_nls - | l_brace r_brace opt_semi opt_nls - ; + : l_brace statements r_brace opt_semi opt_nls + | l_brace r_brace opt_semi opt_nls + ; statements - : statement - | statements statement - | error - | statements error - ; + : statement + | statements statement + | error + | statements error + ; statement_term - : nls - | semi opt_nls - ; + : nls + | semi opt_nls + ; statement - : semi opt_nls - | l_brace r_brace - | l_brace statements r_brace - | if_statement - | LEX_WHILE '(' exp r_paren opt_nls statement - | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls - | LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement - | LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement - | LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement - | LEX_BREAK statement_term - | LEX_CONTINUE statement_term - | print '(' expression_list r_paren output_redir statement_term - | print opt_rexpression_list output_redir statement_term - | LEX_NEXT statement_term - | LEX_NEXTFILE statement_term - | LEX_EXIT opt_exp statement_term - | LEX_RETURN {} opt_exp statement_term - | LEX_DELETE NAME '[' expression_list ']' statement_term - | LEX_DELETE NAME statement_term - | exp statement_term - ; + : semi opt_nls + | l_brace r_brace + | l_brace statements r_brace + | if_statement + | LEX_WHILE '(' exp r_paren opt_nls statement + | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls + | LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement + | LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement + | LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement + | LEX_BREAK statement_term + | LEX_CONTINUE statement_term + | print '(' expression_list r_paren output_redir statement_term + | print opt_rexpression_list output_redir statement_term + | LEX_NEXT statement_term + | LEX_NEXTFILE statement_term + | LEX_EXIT opt_exp statement_term + | LEX_RETURN {} opt_exp statement_term + | LEX_DELETE NAME '[' expression_list ']' statement_term + | LEX_DELETE NAME statement_term + | exp statement_term + ; print - : LEX_PRINT - | LEX_PRINTF - ; + : LEX_PRINT + | LEX_PRINTF + ; if_statement - : LEX_IF '(' exp r_paren opt_nls statement - | LEX_IF '(' exp r_paren opt_nls statement - LEX_ELSE opt_nls statement - ; + : LEX_IF '(' exp r_paren opt_nls statement + | LEX_IF '(' exp r_paren opt_nls statement + LEX_ELSE opt_nls statement + ; nls - : NEWLINE - | nls NEWLINE - ; + : NEWLINE + | nls NEWLINE + ; opt_nls - : /* empty */ - | nls - ; + : /* empty */ + | nls + ; input_redir - : /* empty */ - | '<' simp_exp - ; + : /* empty */ + | '<' simp_exp + ; output_redir - : /* empty */ - | '>' exp - | APPEND_OP exp - | '|' exp - | TWOWAYIO exp - ; + : /* empty */ + | '>' exp + | APPEND_OP exp + | '|' exp + | TWOWAYIO exp + ; opt_param_list - : /* empty */ - | param_list - ; + : /* empty */ + | param_list + ; param_list - : NAME - | param_list comma NAME - | error - | param_list error - | param_list comma error - ; + : NAME + | param_list comma NAME + | error + | param_list error + | param_list comma error + ; /* optional expression, as in for loop */ opt_exp - : /* empty */ - | exp - ; + : /* empty */ + | exp + ; opt_rexpression_list - : /* empty */ - | rexpression_list - ; + : /* empty */ + | rexpression_list + ; rexpression_list - : rexp - | rexpression_list comma rexp - | error - | rexpression_list error - | rexpression_list error rexp - | rexpression_list comma error - ; + : rexp + | rexpression_list comma rexp + | error + | rexpression_list error + | rexpression_list error rexp + | rexpression_list comma error + ; opt_expression_list - : /* empty */ - | expression_list - ; + : /* empty */ + | expression_list + ; expression_list - : exp - | expression_list comma exp - | error - | expression_list error - | expression_list error exp - | expression_list comma error - ; + : exp + | expression_list comma exp + | error + | expression_list error + | expression_list error exp + | expression_list comma error + ; /* Expressions, not including the comma operator. */ -exp : variable ASSIGNOP {} exp - | '(' expression_list r_paren LEX_IN NAME - | exp '|' LEX_GETLINE opt_variable - | exp TWOWAYIO LEX_GETLINE opt_variable - | LEX_GETLINE opt_variable input_redir - | exp LEX_AND exp - | exp LEX_OR exp - | exp MATCHOP exp - | regexp - | '!' regexp %prec UNARY - | exp LEX_IN NAME - | exp RELOP exp - | exp '<' exp - | exp '>' exp - | exp '?' exp ':' exp - | simp_exp - | exp simp_exp %prec CONCAT_OP - ; +exp : variable ASSIGNOP {} exp + | '(' expression_list r_paren LEX_IN NAME + | exp '|' LEX_GETLINE opt_variable + | exp TWOWAYIO LEX_GETLINE opt_variable + | LEX_GETLINE opt_variable input_redir + | exp LEX_AND exp + | exp LEX_OR exp + | exp MATCHOP exp + | regexp + | '!' regexp %prec UNARY + | exp LEX_IN NAME + | exp RELOP exp + | exp '<' exp + | exp '>' exp + | exp '?' exp ':' exp + | simp_exp + | exp simp_exp %prec CONCAT_OP + ; rexp - : variable ASSIGNOP {} rexp - | rexp LEX_AND rexp - | rexp LEX_OR rexp - | LEX_GETLINE opt_variable input_redir - | regexp - | '!' regexp %prec UNARY - | rexp MATCHOP rexp - | rexp LEX_IN NAME - | rexp RELOP rexp - | rexp '?' rexp ':' rexp - | simp_exp - | rexp simp_exp %prec CONCAT_OP - ; + : variable ASSIGNOP {} rexp + | rexp LEX_AND rexp + | rexp LEX_OR rexp + | LEX_GETLINE opt_variable input_redir + | regexp + | '!' regexp %prec UNARY + | rexp MATCHOP rexp + | rexp LEX_IN NAME + | rexp RELOP rexp + | rexp '?' rexp ':' rexp + | simp_exp + | rexp simp_exp %prec CONCAT_OP + ; simp_exp - : non_post_simp_exp - /* Binary operators in order of decreasing precedence. */ - | simp_exp '^' simp_exp - | simp_exp '*' simp_exp - | simp_exp '/' simp_exp - | simp_exp '%' simp_exp - | simp_exp '+' simp_exp - | simp_exp '-' simp_exp - | variable INCREMENT - | variable DECREMENT - ; + : non_post_simp_exp + /* Binary operators in order of decreasing precedence. */ + | simp_exp '^' simp_exp + | simp_exp '*' simp_exp + | simp_exp '/' simp_exp + | simp_exp '%' simp_exp + | simp_exp '+' simp_exp + | simp_exp '-' simp_exp + | variable INCREMENT + | variable DECREMENT + ; non_post_simp_exp - : '!' simp_exp %prec UNARY - | '(' exp r_paren - | LEX_BUILTIN - '(' opt_expression_list r_paren - | LEX_LENGTH '(' opt_expression_list r_paren - | LEX_LENGTH - | FUNC_CALL '(' opt_expression_list r_paren - | variable - | INCREMENT variable - | DECREMENT variable - | YNUMBER - | YSTRING - | '-' simp_exp %prec UNARY - | '+' simp_exp %prec UNARY - ; + : '!' simp_exp %prec UNARY + | '(' exp r_paren + | LEX_BUILTIN + '(' opt_expression_list r_paren + | LEX_LENGTH '(' opt_expression_list r_paren + | LEX_LENGTH + | FUNC_CALL '(' opt_expression_list r_paren + | variable + | INCREMENT variable + | DECREMENT variable + | YNUMBER + | YSTRING + | '-' simp_exp %prec UNARY + | '+' simp_exp %prec UNARY + ; opt_variable - : /* empty */ - | variable - ; + : /* empty */ + | variable + ; variable - : NAME - | NAME '[' expression_list ']' - | '$' non_post_simp_exp - ; + : NAME + | NAME '[' expression_list ']' + | '$' non_post_simp_exp + ; l_brace - : '{' opt_nls - ; + : '{' opt_nls + ; r_brace - : '}' opt_nls - ; + : '}' opt_nls + ; r_paren - : ')' - ; + : ')' + ; opt_semi - : /* empty */ - | semi - ; + : /* empty */ + | semi + ; semi - : ';' - ; + : ';' + ; -comma : ',' opt_nls - ; +comma : ',' opt_nls + ; ]], dnl INPUT @@ -403,32 +403,60 @@ dnl parses it as: dnl dnl getline $!(4*0); dnl -dnl That is, they shift `*' immediately and make it part of the getline +dnl That is, they shift '*' immediately and make it part of the getline dnl argument. dnl dnl The grammar below using LALR(1) parses it as a syntax error. So does dnl GNU AWK 3.0.6, 3.1.0, and 3.1.1. They reduce the full getline expression -dnl before shifting `*' even though `*' is not a valid lookahead. +dnl before shifting '*' even though '*' is not a valid lookahead. dnl dnl GNU AWK 3.1.2, 3.1.3, 3.1.4, and 3.1.5 parse it as: dnl dnl (getline $!4)*0; dnl dnl That is, like the other versions of GNU AWK, they reduce the full getline -dnl expression before shifting `*'. However, because of a different LHS on the -dnl getline rule, `*' actually is a valid lookahead. Solaris /usr/xpg4/bin/awk +dnl expression before shifting '*'. However, because of a different LHS on the +dnl getline rule, '*' actually is a valid lookahead. Solaris /usr/xpg4/bin/awk dnl and the Open Group awk specification seem to agree: dnl dnl http://www.opengroup.org/pubs/online/7908799/xcu/awk.html dnl dnl /bin/nawk and /bin/awk on Solaris 10 report it as a syntax error, but they -dnl don't like even `print $!4;'. +dnl don't like even 'print $!4;'. [[LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';']], dnl BISON-STDERR -[AT_COND_CASE([[canonical LR]], -[[input.y: conflicts: 265 shift/reduce]], -[[input.y: conflicts: 65 shift/reduce]])[ +[[input.y:66.10: warning: empty rule without %empty [-Wempty-rule] +input.y:169.8: warning: empty rule without %empty [-Wempty-rule] +input.y:174.12: warning: empty rule without %empty [-Wempty-rule] +input.y:179.13: warning: empty rule without %empty [-Wempty-rule] +input.y:187.15: warning: empty rule without %empty [-Wempty-rule] +input.y:201.8: warning: empty rule without %empty [-Wempty-rule] +input.y:206.21: warning: empty rule without %empty [-Wempty-rule] +input.y:220.20: warning: empty rule without %empty [-Wempty-rule] +input.y:299.13: warning: empty rule without %empty [-Wempty-rule] +input.y:322.9: warning: empty rule without %empty [-Wempty-rule] +]AT_COND_CASE([[canonical LR]], +[[input.y: warning: 265 shift/reduce conflicts [-Wconflicts-sr]]], +[[input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr]]])[ +input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] +input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] +input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] +input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] +input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] +input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] +input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] +input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] +input.y:50.1-5: warning: useless associativity for '$', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] ]], dnl LAST-STATE @@ -783,33 +811,33 @@ dnl In the case of the syntax error, the parser recovers, so it returns 0. AT_TEST_EXISTING_GRAMMAR([[GNU Cim Grammar]], [[ %token - HACTIVATE HAFTER /*HAND*/ HARRAY HAT - HBEFORE HBEGIN HBOOLEAN - HCHARACTER HCLASS /*HCOMMENT*/ HCONC - HDELAY HDO - HELSE HEND HEQ /*HEQV*/ HEXTERNAL - HFOR - HGE HGO HGOTO HGT - HHIDDEN - HIF /*HIMP*/ HIN HINNER HINSPECT HINTEGER HIS - HLABEL HLE HLONG HLT - HNAME HNE HNEW HNONE /*HNOT*/ HNOTEXT - /*HOR*/ HOTHERWISE - HPRIOR HPROCEDURE HPROTECTED - HQUA - HREACTIVATE HREAL HREF - HSHORT HSTEP HSWITCH - HTEXT HTHEN HTHIS HTO - HUNTIL - HVALUE HVAR HVIRTUAL - HWHEN HWHILE - - HASSIGNVALUE HASSIGNREF - /*HDOT*/ HPAREXPSEPARATOR HLABELSEPARATOR HSTATEMENTSEPARATOR - HBEGPAR HENDPAR - HEQR HNER - HADD HSUB HMUL HDIV HINTDIV HEXP - HDOTDOTDOT + HACTIVATE HAFTER /*HAND*/ HARRAY HAT + HBEFORE HBEGIN HBOOLEAN + HCHARACTER HCLASS /*HCOMMENT*/ HCONC + HDELAY HDO + HELSE HEND HEQ /*HEQV*/ HEXTERNAL + HFOR + HGE HGO HGOTO HGT + HHIDDEN + HIF /*HIMP*/ HIN HINNER HINSPECT HINTEGER HIS + HLABEL HLE HLONG HLT + HNAME HNE HNEW HNONE /*HNOT*/ HNOTEXT + /*HOR*/ HOTHERWISE + HPRIOR HPROCEDURE HPROTECTED + HQUA + HREACTIVATE HREAL HREF + HSHORT HSTEP HSWITCH + HTEXT HTHEN HTHIS HTO + HUNTIL + HVALUE HVAR HVIRTUAL + HWHEN HWHILE + + HASSIGNVALUE HASSIGNREF + /*HDOT*/ HPAREXPSEPARATOR HLABELSEPARATOR HSTATEMENTSEPARATOR + HBEGPAR HENDPAR + HEQR HNER + HADD HSUB HMUL HDIV HINTDIV HEXP + HDOTDOTDOT %token HIDENTIFIER %token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST @@ -829,7 +857,7 @@ AT_TEST_EXISTING_GRAMMAR([[GNU Cim Grammar]], %left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR -%left HCONC +%left HCONC %left HTERMOPERATOR %left UNEAR @@ -845,531 +873,561 @@ AT_TEST_EXISTING_GRAMMAR([[GNU Cim Grammar]], [[ /* GRAMATIKK FOR PROGRAM MODULES */ MAIN_MODULE : {} - MODULS - | error HSTATEMENTSEPARATOR MBEE_DECLSTMS - ; -EXT_DECLARATION : HEXTERNAL - MBEE_TYPE - HPROCEDURE - {} - EXT_LIST - | - HEXTERNAL - HIDENTIFIER - HPROCEDURE - {} - HIDENTIFIER {} - EXTERNAL_KIND_ITEM - | HEXTERNAL - HCLASS - {} - EXT_LIST - - ; -EXTERNAL_KIND_ITEM: EXT_IDENT - HOBJRELOPERATOR - {} - MBEE_TYPE HPROCEDURE - HIDENTIFIER - {} - HEADING EMPTY_BLOCK - {} -/* | - EXT_IDENT - {} - MBEE_REST_EXT_LIST - ; -MBEE_REST_EXT_LIST: /* EMPTY - | HPAREXPSEPARATOR EXT_KIND_LIST - ; -EXT_KIND_LIST : EXT_KIND_ITEM - | EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM - ; -EXT_KIND_ITEM : HIDENTIFIER - EXT_IDENT - {}*/ - ; -EMPTY_BLOCK : /*EMPT*/ - | HBEGIN HEND - ; -EXT_LIST : EXT_ITEM - | EXT_LIST HPAREXPSEPARATOR EXT_ITEM - ; -EXT_ITEM : HIDENTIFIER - EXT_IDENT - ; -EXT_IDENT : /* EMPTY */ - | HVALRELOPERATOR {} - HTEXTKONST - ; + MODULS + | error HSTATEMENTSEPARATOR MBEE_DECLSTMS + ; +EXT_DECLARATION : HEXTERNAL + MBEE_TYPE + HPROCEDURE + {} + EXT_LIST + | + HEXTERNAL + HIDENTIFIER + HPROCEDURE + {} + HIDENTIFIER {} + EXTERNAL_KIND_ITEM + | HEXTERNAL + HCLASS + {} + EXT_LIST + + ; +EXTERNAL_KIND_ITEM: EXT_IDENT + HOBJRELOPERATOR + {} + MBEE_TYPE HPROCEDURE + HIDENTIFIER + {} + HEADING EMPTY_BLOCK + {} +/* | + EXT_IDENT + {} + MBEE_REST_EXT_LIST + ; +MBEE_REST_EXT_LIST: /* EMPTY + | HPAREXPSEPARATOR EXT_KIND_LIST + ; +EXT_KIND_LIST : EXT_KIND_ITEM + | EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM + ; +EXT_KIND_ITEM : HIDENTIFIER + EXT_IDENT + {}*/ + ; +EMPTY_BLOCK : /*EMPT*/ + | HBEGIN HEND + ; +EXT_LIST : EXT_ITEM + | EXT_LIST HPAREXPSEPARATOR EXT_ITEM + ; +EXT_ITEM : HIDENTIFIER + EXT_IDENT + ; +EXT_IDENT : /* EMPTY */ + | HVALRELOPERATOR {} + HTEXTKONST + ; /* GRAMATIKK FOR TYPER */ NO_TYPE : /*EMPT*/ - ; + ; MBEE_TYPE : NO_TYPE - | TYPE - ; + | TYPE + ; TYPE : HREF HBEGPAR - HIDENTIFIER - {} - HENDPAR - | HTEXT - | HBOOLEAN - | HCHARACTER - | HSHORT HINTEGER - | HINTEGER - | HREAL - | HLONG HREAL - ; + HIDENTIFIER + {} + HENDPAR + | HTEXT + | HBOOLEAN + | HCHARACTER + | HSHORT HINTEGER + | HINTEGER + | HREAL + | HLONG HREAL + ; /* GRAMATIKK FOR DEL AV SETNINGER */ MBEE_ELSE_PART : /*EMPT*/ -/* | HELSE - HIF - EXPRESSION - HTHEN {} - BLOCK {} - MBEE_ELSE_PART {}*/ - | HELSE {} - BLOCK - ; +/* | HELSE + HIF + EXPRESSION + HTHEN {} + BLOCK {} + MBEE_ELSE_PART {}*/ + | HELSE {} + BLOCK + ; FOR_LIST : FOR_LIST_ELEMENT - | FOR_LIST_ELEMENT - HPAREXPSEPARATOR - FOR_LIST - ; + | FOR_LIST_ELEMENT + HPAREXPSEPARATOR + FOR_LIST + ; FOR_LIST_ELEMENT: EXPRESSION - MBEE_F_L_EL_R_PT - ; + MBEE_F_L_EL_R_PT + ; MBEE_F_L_EL_R_PT: /*EMPT*/ - | HWHILE - EXPRESSION - | HSTEP - EXPRESSION - HUNTIL - EXPRESSION - ; + | HWHILE + EXPRESSION + | HSTEP + EXPRESSION + HUNTIL + EXPRESSION + ; GOTO : HGO - HTO - | HGOTO - ; + HTO + | HGOTO + ; CONN_STATE_R_PT : WHEN_CLAUSE_LIST - | HDO {} - BLOCK - ; + | HDO {} + BLOCK + ; WHEN_CLAUSE_LIST: HWHEN - HIDENTIFIER - HDO {} - BLOCK - | WHEN_CLAUSE_LIST - HWHEN - HIDENTIFIER - HDO {} - BLOCK - ; + HIDENTIFIER + HDO {} + BLOCK + | WHEN_CLAUSE_LIST + HWHEN + HIDENTIFIER + HDO {} + BLOCK + ; MBEE_OTWI_CLAUS : /*EMPT*/ - | HOTHERWISE {} - - BLOCK - ; -ACTIVATOR : HACTIVATE - | HREACTIVATE - ; -SCHEDULE : /*EMPT*/ - | ATDELAY EXPRESSION {} - PRIOR - | BEFOREAFTER {} - EXPRESSION - ; -ATDELAY : HAT - | HDELAY - ; -BEFOREAFTER : HBEFORE - | HAFTER - ; -PRIOR : /*EMPT*/ - | HPRIOR - ; + | HOTHERWISE {} + + BLOCK + ; +ACTIVATOR : HACTIVATE + | HREACTIVATE + ; +SCHEDULE : /*EMPT*/ + | ATDELAY EXPRESSION {} + PRIOR + | BEFOREAFTER {} + EXPRESSION + ; +ATDELAY : HAT + | HDELAY + ; +BEFOREAFTER : HBEFORE + | HAFTER + ; +PRIOR : /*EMPT*/ + | HPRIOR + ; /* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */ MODULSTATEMENT : HWHILE - EXPRESSION - HDO {} - BLOCK - | HIF - EXPRESSION - HTHEN {} - BLOCK {} - MBEE_ELSE_PART - | HFOR - HIDENTIFIER - HASSIGN {} - FOR_LIST - HDO {} - BLOCK - | GOTO - EXPRESSION - | HINSPECT - EXPRESSION {} - CONN_STATE_R_PT - {} - MBEE_OTWI_CLAUS - | HINNER - | HIDENTIFIER - HLABELSEPARATOR - {} - DECLSTATEMENT - | EXPRESSION_SIMP - HBEGIN - {} - IMPORT_SPEC_MODULE - {} - MBEE_DECLSTMS - HEND - | EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR - MBEE_DECLSTMS HEND - | EXPRESSION_SIMP HBEGIN error HEND - | EXPRESSION_SIMP - | ACTIVATOR EXPRESSION SCHEDULE - | HBEGIN - {} - MBEE_DECLSTMS - HEND - | MBEE_TYPE HPROCEDURE - HIDENTIFIER - {} - HEADING BLOCK - | HIDENTIFIER - HCLASS - NO_TYPE - {} - IMPORT_SPEC_MODULE - HIDENTIFIER - {} - HEADING - BLOCK - | HCLASS - NO_TYPE - HIDENTIFIER - {} - HEADING - BLOCK - | EXT_DECLARATION - | /*EMPT*/ - ; + EXPRESSION + HDO {} + BLOCK + | HIF + EXPRESSION + HTHEN {} + BLOCK {} + MBEE_ELSE_PART + | HFOR + HIDENTIFIER + HASSIGN {} + FOR_LIST + HDO {} + BLOCK + | GOTO + EXPRESSION + | HINSPECT + EXPRESSION {} + CONN_STATE_R_PT + {} + MBEE_OTWI_CLAUS + | HINNER + | HIDENTIFIER + HLABELSEPARATOR + {} + DECLSTATEMENT + | EXPRESSION_SIMP + HBEGIN + {} + IMPORT_SPEC_MODULE + {} + MBEE_DECLSTMS + HEND + | EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR + MBEE_DECLSTMS HEND + | EXPRESSION_SIMP HBEGIN error HEND + | EXPRESSION_SIMP + | ACTIVATOR EXPRESSION SCHEDULE + | HBEGIN + {} + MBEE_DECLSTMS + HEND + | MBEE_TYPE HPROCEDURE + HIDENTIFIER + {} + HEADING BLOCK + | HIDENTIFIER + HCLASS + NO_TYPE + {} + IMPORT_SPEC_MODULE + HIDENTIFIER + {} + HEADING + BLOCK + | HCLASS + NO_TYPE + HIDENTIFIER + {} + HEADING + BLOCK + | EXT_DECLARATION + | /*EMPT*/ + ; IMPORT_SPEC_MODULE: - ; -DECLSTATEMENT : MODULSTATEMENT - | TYPE - HIDENTIFIER - MBEE_CONSTANT - HPAREXPSEPARATOR - {} - IDENTIFIER_LISTC - | TYPE - HIDENTIFIER - MBEE_CONSTANT - | MBEE_TYPE - HARRAY {} - ARR_SEGMENT_LIST - | HSWITCH - HIDENTIFIER - HASSIGN {} - SWITCH_LIST - ; + ; +DECLSTATEMENT : MODULSTATEMENT + | TYPE + HIDENTIFIER + MBEE_CONSTANT + HPAREXPSEPARATOR + {} + IDENTIFIER_LISTC + | TYPE + HIDENTIFIER + MBEE_CONSTANT + | MBEE_TYPE + HARRAY {} + ARR_SEGMENT_LIST + | HSWITCH + HIDENTIFIER + HASSIGN {} + SWITCH_LIST + ; BLOCK : DECLSTATEMENT - | HBEGIN MBEE_DECLSTMS HEND - | HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND - | HBEGIN error HEND - ; + | HBEGIN MBEE_DECLSTMS HEND + | HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND + | HBEGIN error HEND + ; MBEE_DECLSTMS : MBEE_DECLSTMSU - ; + ; MBEE_DECLSTMSU : DECLSTATEMENT - | MBEE_DECLSTMSU - HSTATEMENTSEPARATOR - DECLSTATEMENT - ; -MODULS : MODULSTATEMENT - | MODULS HSTATEMENTSEPARATOR MODULSTATEMENT - ; + | MBEE_DECLSTMSU + HSTATEMENTSEPARATOR + DECLSTATEMENT + ; +MODULS : MODULSTATEMENT + | MODULS HSTATEMENTSEPARATOR MODULSTATEMENT + ; /* GRAMATIKK FOR DEL AV DEKLARASJONER */ ARR_SEGMENT_LIST: ARR_SEGMENT - | ARR_SEGMENT_LIST - HPAREXPSEPARATOR - ARR_SEGMENT - ; -ARR_SEGMENT : ARRAY_SEGMENT - HBEGPAR - BAUND_PAIR_LIST HENDPAR - ; + | ARR_SEGMENT_LIST + HPAREXPSEPARATOR + ARR_SEGMENT + ; +ARR_SEGMENT : ARRAY_SEGMENT + HBEGPAR + BAUND_PAIR_LIST HENDPAR + ; ARRAY_SEGMENT : ARRAY_SEGMENT_EL {} - | ARRAY_SEGMENT_EL - HPAREXPSEPARATOR - ARRAY_SEGMENT - ; + | ARRAY_SEGMENT_EL + HPAREXPSEPARATOR + ARRAY_SEGMENT + ; ARRAY_SEGMENT_EL: HIDENTIFIER - ; + ; BAUND_PAIR_LIST : BAUND_PAIR - | BAUND_PAIR - HPAREXPSEPARATOR - BAUND_PAIR_LIST - ; + | BAUND_PAIR + HPAREXPSEPARATOR + BAUND_PAIR_LIST + ; BAUND_PAIR : EXPRESSION - HLABELSEPARATOR - EXPRESSION - ; + HLABELSEPARATOR + EXPRESSION + ; SWITCH_LIST : EXPRESSION - | EXPRESSION - HPAREXPSEPARATOR - SWITCH_LIST - ; + | EXPRESSION + HPAREXPSEPARATOR + SWITCH_LIST + ; HEADING : MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {} - MBEE_MODE_PART {} - MBEE_SPEC_PART {} - MBEE_PROT_PART {} - MBEE_VIRT_PART - ; + MBEE_MODE_PART {} + MBEE_SPEC_PART {} + MBEE_PROT_PART {} + MBEE_VIRT_PART + ; MBEE_FMAL_PAR_P : /*EMPT*/ - | FMAL_PAR_PART - ; + | FMAL_PAR_PART + ; FMAL_PAR_PART : HBEGPAR NO_TYPE - MBEE_LISTV HENDPAR - ; + MBEE_LISTV HENDPAR + ; MBEE_LISTV : /*EMPT*/ - | LISTV - ; + | LISTV + ; LISTV : HIDENTIFIER - | FPP_CATEG HDOTDOTDOT - | HIDENTIFIER {} - HPAREXPSEPARATOR LISTV - | FPP_SPEC - | FPP_SPEC - HPAREXPSEPARATOR LISTV - ; + | FPP_CATEG HDOTDOTDOT + | HIDENTIFIER {} + HPAREXPSEPARATOR LISTV + | FPP_SPEC + | FPP_SPEC + HPAREXPSEPARATOR LISTV + ; FPP_HEADING : HBEGPAR NO_TYPE - FPP_MBEE_LISTV HENDPAR - ; + FPP_MBEE_LISTV HENDPAR + ; FPP_MBEE_LISTV : /*EMPT*/ - | FPP_LISTV - ; -FPP_LISTV : FPP_CATEG HDOTDOTDOT - | FPP_SPEC - | FPP_SPEC - HPAREXPSEPARATOR LISTV - ; + | FPP_LISTV + ; +FPP_LISTV : FPP_CATEG HDOTDOTDOT + | FPP_SPEC + | FPP_SPEC + HPAREXPSEPARATOR LISTV + ; FPP_SPEC : FPP_CATEG SPECIFIER HIDENTIFIER - | FPP_CATEG FPP_PROC_DECL_IN_SPEC - ; + | FPP_CATEG FPP_PROC_DECL_IN_SPEC + ; FPP_CATEG : HNAME HLABELSEPARATOR - | HVALUE HLABELSEPARATOR - | HVAR HLABELSEPARATOR - | /*EMPT*/ - ; -FPP_PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE - HIDENTIFIER - {} - FPP_HEADING {} { /* Yes, two "final" actions. */ } - ; + | HVALUE HLABELSEPARATOR + | HVAR HLABELSEPARATOR + | /*EMPT*/ + ; +FPP_PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE + HIDENTIFIER + {} + FPP_HEADING {} { /* Yes, two "final" actions. */ } + ; IDENTIFIER_LISTV: HIDENTIFIER - | HDOTDOTDOT - | HIDENTIFIER {} - HPAREXPSEPARATOR IDENTIFIER_LISTV - ; + | HDOTDOTDOT + | HIDENTIFIER {} + HPAREXPSEPARATOR IDENTIFIER_LISTV + ; MBEE_MODE_PART : /*EMPT*/ - | MODE_PART - ; + | MODE_PART + ; MODE_PART : NAME_PART - | VALUE_PART - | VAR_PART - | NAME_PART VALUE_PART - | VALUE_PART NAME_PART - | NAME_PART VAR_PART - | VAR_PART NAME_PART - | VALUE_PART VAR_PART - | VAR_PART VALUE_PART - | VAR_PART NAME_PART VALUE_PART - | NAME_PART VAR_PART VALUE_PART - | NAME_PART VALUE_PART VAR_PART - | VAR_PART VALUE_PART NAME_PART - | VALUE_PART VAR_PART NAME_PART - | VALUE_PART NAME_PART VAR_PART - ; + | VALUE_PART + | VAR_PART + | NAME_PART VALUE_PART + | VALUE_PART NAME_PART + | NAME_PART VAR_PART + | VAR_PART NAME_PART + | VALUE_PART VAR_PART + | VAR_PART VALUE_PART + | VAR_PART NAME_PART VALUE_PART + | NAME_PART VAR_PART VALUE_PART + | NAME_PART VALUE_PART VAR_PART + | VAR_PART VALUE_PART NAME_PART + | VALUE_PART VAR_PART NAME_PART + | VALUE_PART NAME_PART VAR_PART + ; NAME_PART : HNAME {} - IDENTIFIER_LISTV - HSTATEMENTSEPARATOR - ; + IDENTIFIER_LISTV + HSTATEMENTSEPARATOR + ; VAR_PART : HVAR {} - IDENTIFIER_LISTV - HSTATEMENTSEPARATOR - ; + IDENTIFIER_LISTV + HSTATEMENTSEPARATOR + ; VALUE_PART : HVALUE {} - IDENTIFIER_LISTV HSTATEMENTSEPARATOR - ; + IDENTIFIER_LISTV HSTATEMENTSEPARATOR + ; MBEE_SPEC_PART : /*EMPT*/ - | SPEC_PART - ; + | SPEC_PART + ; SPEC_PART : ONE_SPEC - | SPEC_PART ONE_SPEC - ; -ONE_SPEC : SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR - | NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR - {} - PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR - | FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR - | MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR - | MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR - IDENTIFIER_LIST HSTATEMENTSEPARATOR - ; + | SPEC_PART ONE_SPEC + ; +ONE_SPEC : SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR + | NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR + {} + PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR + | FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR + | MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR + | MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR + IDENTIFIER_LIST HSTATEMENTSEPARATOR + ; SPECIFIER : TYPE - | MBEE_TYPE - HARRAY - | HLABEL - | HSWITCH - ; -PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE - HIDENTIFIER - {} - HEADING - {} - MBEE_BEGIN_END - ; -MBEE_BEGIN_END : /* EMPTY */ - | HBEGIN HEND - ; + | MBEE_TYPE + HARRAY + | HLABEL + | HSWITCH + ; +PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE + HIDENTIFIER + {} + HEADING + {} + MBEE_BEGIN_END + ; +MBEE_BEGIN_END : /* EMPTY */ + | HBEGIN HEND + ; MBEE_PROT_PART : /*EMPT*/ - | PROTECTION_PART - ; + | PROTECTION_PART + ; PROTECTION_PART : PROT_SPECIFIER IDENTIFIER_LIST - HSTATEMENTSEPARATOR - | PROTECTION_PART PROT_SPECIFIER - IDENTIFIER_LIST HSTATEMENTSEPARATOR - ; + HSTATEMENTSEPARATOR + | PROTECTION_PART PROT_SPECIFIER + IDENTIFIER_LIST HSTATEMENTSEPARATOR + ; PROT_SPECIFIER : HHIDDEN - | HPROTECTED - | HHIDDEN - HPROTECTED - | HPROTECTED - HHIDDEN - ; + | HPROTECTED + | HHIDDEN + HPROTECTED + | HPROTECTED + HHIDDEN + ; MBEE_VIRT_PART : /*EMPT*/ - | VIRTUAL_PART - ; + | VIRTUAL_PART + ; VIRTUAL_PART : HVIRTUAL - HLABELSEPARATOR - MBEE_SPEC_PART - ; + HLABELSEPARATOR + MBEE_SPEC_PART + ; IDENTIFIER_LIST : HIDENTIFIER - | IDENTIFIER_LIST HPAREXPSEPARATOR - HIDENTIFIER - ; + | IDENTIFIER_LIST HPAREXPSEPARATOR + HIDENTIFIER + ; IDENTIFIER_LISTC: HIDENTIFIER - MBEE_CONSTANT - | IDENTIFIER_LISTC HPAREXPSEPARATOR - HIDENTIFIER - MBEE_CONSTANT - ; -MBEE_CONSTANT : /* EMPTY */ - | HVALRELOPERATOR - {} - EXPRESSION - ; + MBEE_CONSTANT + | IDENTIFIER_LISTC HPAREXPSEPARATOR + HIDENTIFIER + MBEE_CONSTANT + ; +MBEE_CONSTANT : /* EMPTY */ + | HVALRELOPERATOR + {} + EXPRESSION + ; /* GRAMATIKK FOR UTTRYKK */ EXPRESSION : EXPRESSION_SIMP - | HIF - EXPRESSION - HTHEN - EXPRESSION - HELSE - EXPRESSION - ; -EXPRESSION_SIMP : EXPRESSION_SIMP - HASSIGN - EXPRESSION - | - - EXPRESSION_SIMP - HCONC - EXPRESSION_SIMP - | EXPRESSION_SIMP HOR - HELSE - EXPRESSION_SIMP - %prec HORELSE - | EXPRESSION_SIMP HAND - HTHEN - EXPRESSION_SIMP - %prec HANDTHEN - | EXPRESSION_SIMP - HEQV EXPRESSION_SIMP - | EXPRESSION_SIMP - HIMP EXPRESSION_SIMP - | EXPRESSION_SIMP - HOR EXPRESSION_SIMP - | EXPRESSION_SIMP - HAND EXPRESSION_SIMP - | HNOT EXPRESSION_SIMP - | EXPRESSION_SIMP - HVALRELOPERATOR - EXPRESSION_SIMP - | EXPRESSION_SIMP - HREFRELOPERATOR - EXPRESSION_SIMP - | EXPRESSION_SIMP - HOBJRELOPERATOR - EXPRESSION_SIMP - | HTERMOPERATOR - EXPRESSION_SIMP %prec UNEAR - | EXPRESSION_SIMP - HTERMOPERATOR - EXPRESSION_SIMP - | EXPRESSION_SIMP - HFACTOROPERATOR - EXPRESSION_SIMP - | EXPRESSION_SIMP - HPRIMARYOPERATOR - EXPRESSION_SIMP - | HBEGPAR - EXPRESSION HENDPAR - | HTEXTKONST - | HCHARACTERKONST - | HREALKONST - | HINTEGERKONST - | HBOOLEANKONST - | HNONE - | HIDENTIFIER - {} - MBEE_ARG_R_PT - | HTHIS HIDENTIFIER - | HNEW - HIDENTIFIER - ARG_R_PT - | EXPRESSION_SIMP - HDOT - EXPRESSION_SIMP - | EXPRESSION_SIMP - HQUA HIDENTIFIER - ; + | HIF + EXPRESSION + HTHEN + EXPRESSION + HELSE + EXPRESSION + ; +EXPRESSION_SIMP : EXPRESSION_SIMP + HASSIGN + EXPRESSION + | + + EXPRESSION_SIMP + HCONC + EXPRESSION_SIMP + | EXPRESSION_SIMP HOR + HELSE + EXPRESSION_SIMP + %prec HORELSE + | EXPRESSION_SIMP HAND + HTHEN + EXPRESSION_SIMP + %prec HANDTHEN + | EXPRESSION_SIMP + HEQV EXPRESSION_SIMP + | EXPRESSION_SIMP + HIMP EXPRESSION_SIMP + | EXPRESSION_SIMP + HOR EXPRESSION_SIMP + | EXPRESSION_SIMP + HAND EXPRESSION_SIMP + | HNOT EXPRESSION_SIMP + | EXPRESSION_SIMP + HVALRELOPERATOR + EXPRESSION_SIMP + | EXPRESSION_SIMP + HREFRELOPERATOR + EXPRESSION_SIMP + | EXPRESSION_SIMP + HOBJRELOPERATOR + EXPRESSION_SIMP + | HTERMOPERATOR + EXPRESSION_SIMP %prec UNEAR + | EXPRESSION_SIMP + HTERMOPERATOR + EXPRESSION_SIMP + | EXPRESSION_SIMP + HFACTOROPERATOR + EXPRESSION_SIMP + | EXPRESSION_SIMP + HPRIMARYOPERATOR + EXPRESSION_SIMP + | HBEGPAR + EXPRESSION HENDPAR + | HTEXTKONST + | HCHARACTERKONST + | HREALKONST + | HINTEGERKONST + | HBOOLEANKONST + | HNONE + | HIDENTIFIER + {} + MBEE_ARG_R_PT + | HTHIS HIDENTIFIER + | HNEW + HIDENTIFIER + ARG_R_PT + | EXPRESSION_SIMP + HDOT + EXPRESSION_SIMP + | EXPRESSION_SIMP + HQUA HIDENTIFIER + ; ARG_R_PT : /*EMPTY*/ - | HBEGPAR - ARGUMENT_LIST HENDPAR - ; + | HBEGPAR + ARGUMENT_LIST HENDPAR + ; MBEE_ARG_R_PT : /*EMPTY*/ - | HBEGPAR - ARGUMENT_LIST HENDPAR - ; + | HBEGPAR + ARGUMENT_LIST HENDPAR + ; ARGUMENT_LIST : EXPRESSION - | EXPRESSION - HPAREXPSEPARATOR - ARGUMENT_LIST - ; + | EXPRESSION + HPAREXPSEPARATOR + ARGUMENT_LIST + ; ]], dnl INPUT [[]], dnl BISON-STDERR -[AT_COND_CASE([[canonical LR]], -[[input.y: conflicts: 1876 shift/reduce, 144 reduce/reduce]], -[[input.y: conflicts: 78 shift/reduce, 10 reduce/reduce]])[ +[[input.y:128.12: warning: empty rule without %empty [-Wempty-rule] +input.y:137.10: warning: empty rule without %empty [-Wempty-rule] +input.y:142.8: warning: empty rule without %empty [-Wempty-rule] +input.y:161.15: warning: empty rule without %empty [-Wempty-rule] +input.y:179.17: warning: empty rule without %empty [-Wempty-rule] +input.y:205.16: warning: empty rule without %empty [-Wempty-rule] +input.y:213.9: warning: empty rule without %empty [-Wempty-rule] +input.y:225.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.18: warning: empty rule without %empty [-Wempty-rule] +input.y:294.19: warning: empty rule without %empty [-Wempty-rule] +input.y:367.16: warning: empty rule without %empty [-Wempty-rule] +input.y:373.11: warning: empty rule without %empty [-Wempty-rule] +input.y:387.15: warning: empty rule without %empty [-Wempty-rule] +input.y:401.18: warning: empty rule without %empty [-Wempty-rule] +input.y:413.15: warning: empty rule without %empty [-Wempty-rule] +input.y:443.15: warning: empty rule without %empty [-Wempty-rule] +input.y:471.15: warning: empty rule without %empty [-Wempty-rule] +input.y:474.15: warning: empty rule without %empty [-Wempty-rule] +input.y:489.15: warning: empty rule without %empty [-Wempty-rule] +input.y:506.14: warning: empty rule without %empty [-Wempty-rule] +input.y:587.9: warning: empty rule without %empty [-Wempty-rule] +input.y:591.14: warning: empty rule without %empty [-Wempty-rule] +]AT_COND_CASE([[canonical LR]], +[[input.y: warning: 1876 shift/reduce conflicts [-Wconflicts-sr] +input.y: warning: 144 reduce/reduce conflicts [-Wconflicts-rr]]], +[[input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr] +input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr]]])[ +input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] +input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] +input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] +input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] +input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] +input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] ]], dnl LAST-STATE @@ -1535,7 +1593,7 @@ box "foo" above ljust == box ("foo" above ljust) %left LEFT RIGHT /* Give attributes that take an optional expression a higher -precedence than left and right, so that eg `line chop left' +precedence than left and right, so that eg 'line chop left' parses properly. */ %left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED %left LABEL @@ -1548,7 +1606,7 @@ parses properly. */ /* these need to be lower than '-' */ %left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS -/* these must have higher precedence than CHOP so that `label %prec CHOP' +/* these must have higher precedence than CHOP so that 'label %prec CHOP' works */ %left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C %left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER @@ -1570,367 +1628,367 @@ works */ ]], [[ top: - optional_separator - | element_list - ; + optional_separator + | element_list + ; element_list: - optional_separator middle_element_list optional_separator - ; + optional_separator middle_element_list optional_separator + ; middle_element_list: - element - | middle_element_list separator element - ; + element + | middle_element_list separator element + ; optional_separator: - /* empty */ - | separator - ; + /* empty */ + | separator + ; separator: - ';' - | separator ';' - ; + ';' + | separator ';' + ; placeless_element: - VARIABLE '=' any_expr - | VARIABLE ':' '=' any_expr - | UP - | DOWN - | LEFT - | RIGHT - | COMMAND_LINE - | COMMAND print_args - | PRINT print_args - | SH - {} - DELIMITED - | COPY TEXT - | COPY TEXT THROUGH - {} - DELIMITED - {} - until - | COPY THROUGH - {} - DELIMITED - {} - until - | FOR VARIABLE '=' expr TO expr optional_by DO - {} - DELIMITED - | simple_if - | simple_if ELSE - {} - DELIMITED - | reset_variables - | RESET - ; + VARIABLE '=' any_expr + | VARIABLE ':' '=' any_expr + | UP + | DOWN + | LEFT + | RIGHT + | COMMAND_LINE + | COMMAND print_args + | PRINT print_args + | SH + {} + DELIMITED + | COPY TEXT + | COPY TEXT THROUGH + {} + DELIMITED + {} + until + | COPY THROUGH + {} + DELIMITED + {} + until + | FOR VARIABLE '=' expr TO expr optional_by DO + {} + DELIMITED + | simple_if + | simple_if ELSE + {} + DELIMITED + | reset_variables + | RESET + ; reset_variables: - RESET VARIABLE - | reset_variables VARIABLE - | reset_variables ',' VARIABLE - ; + RESET VARIABLE + | reset_variables VARIABLE + | reset_variables ',' VARIABLE + ; print_args: - print_arg - | print_args print_arg - ; + print_arg + | print_args print_arg + ; print_arg: - expr %prec ',' - | text - | position %prec ',' - ; + expr %prec ',' + | text + | position %prec ',' + ; simple_if: - IF any_expr THEN - {} - DELIMITED - ; + IF any_expr THEN + {} + DELIMITED + ; until: - /* empty */ - | UNTIL TEXT - ; + /* empty */ + | UNTIL TEXT + ; any_expr: - expr - | text_expr - ; + expr + | text_expr + ; text_expr: - text EQUALEQUAL text - | text NOTEQUAL text - | text_expr ANDAND text_expr - | text_expr ANDAND expr - | expr ANDAND text_expr - | text_expr OROR text_expr - | text_expr OROR expr - | expr OROR text_expr - | '!' text_expr - ; + text EQUALEQUAL text + | text NOTEQUAL text + | text_expr ANDAND text_expr + | text_expr ANDAND expr + | expr ANDAND text_expr + | text_expr OROR text_expr + | text_expr OROR expr + | expr OROR text_expr + | '!' text_expr + ; optional_by: - /* empty */ - | BY expr - | BY '*' expr - ; + /* empty */ + | BY expr + | BY '*' expr + ; element: - object_spec - | LABEL ':' optional_separator element - | LABEL ':' optional_separator position_not_place - | LABEL ':' optional_separator place - | '{' {} element_list '}' - {} - optional_element - | placeless_element - ; + object_spec + | LABEL ':' optional_separator element + | LABEL ':' optional_separator position_not_place + | LABEL ':' optional_separator place + | '{' {} element_list '}' + {} + optional_element + | placeless_element + ; optional_element: - /* empty */ - | element - ; + /* empty */ + | element + ; object_spec: - BOX - | CIRCLE - | ELLIPSE - | ARC - | LINE - | ARROW - | MOVE - | SPLINE - | text %prec TEXT - | PLOT expr - | PLOT expr text - | '[' - {} - element_list ']' - | object_spec HEIGHT expr - | object_spec RADIUS expr - | object_spec WIDTH expr - | object_spec DIAMETER expr - | object_spec expr %prec HEIGHT - | object_spec UP - | object_spec UP expr - | object_spec DOWN - | object_spec DOWN expr - | object_spec RIGHT - | object_spec RIGHT expr - | object_spec LEFT - | object_spec LEFT expr - | object_spec FROM position - | object_spec TO position - | object_spec AT position - | object_spec WITH path - | object_spec WITH position %prec ',' - | object_spec BY expr_pair - | object_spec THEN - | object_spec SOLID - | object_spec DOTTED - | object_spec DOTTED expr - | object_spec DASHED - | object_spec DASHED expr - | object_spec FILL - | object_spec FILL expr - | object_spec SHADED text - | object_spec COLORED text - | object_spec OUTLINED text - | object_spec CHOP - | object_spec CHOP expr - | object_spec SAME - | object_spec INVISIBLE - | object_spec LEFT_ARROW_HEAD - | object_spec RIGHT_ARROW_HEAD - | object_spec DOUBLE_ARROW_HEAD - | object_spec CW - | object_spec CCW - | object_spec text %prec TEXT - | object_spec LJUST - | object_spec RJUST - | object_spec ABOVE - | object_spec BELOW - | object_spec THICKNESS expr - | object_spec ALIGNED - ; + BOX + | CIRCLE + | ELLIPSE + | ARC + | LINE + | ARROW + | MOVE + | SPLINE + | text %prec TEXT + | PLOT expr + | PLOT expr text + | '[' + {} + element_list ']' + | object_spec HEIGHT expr + | object_spec RADIUS expr + | object_spec WIDTH expr + | object_spec DIAMETER expr + | object_spec expr %prec HEIGHT + | object_spec UP + | object_spec UP expr + | object_spec DOWN + | object_spec DOWN expr + | object_spec RIGHT + | object_spec RIGHT expr + | object_spec LEFT + | object_spec LEFT expr + | object_spec FROM position + | object_spec TO position + | object_spec AT position + | object_spec WITH path + | object_spec WITH position %prec ',' + | object_spec BY expr_pair + | object_spec THEN + | object_spec SOLID + | object_spec DOTTED + | object_spec DOTTED expr + | object_spec DASHED + | object_spec DASHED expr + | object_spec FILL + | object_spec FILL expr + | object_spec SHADED text + | object_spec COLORED text + | object_spec OUTLINED text + | object_spec CHOP + | object_spec CHOP expr + | object_spec SAME + | object_spec INVISIBLE + | object_spec LEFT_ARROW_HEAD + | object_spec RIGHT_ARROW_HEAD + | object_spec DOUBLE_ARROW_HEAD + | object_spec CW + | object_spec CCW + | object_spec text %prec TEXT + | object_spec LJUST + | object_spec RJUST + | object_spec ABOVE + | object_spec BELOW + | object_spec THICKNESS expr + | object_spec ALIGNED + ; text: - TEXT - | SPRINTF '(' TEXT sprintf_args ')' - ; + TEXT + | SPRINTF '(' TEXT sprintf_args ')' + ; sprintf_args: - /* empty */ - | sprintf_args ',' expr - ; + /* empty */ + | sprintf_args ',' expr + ; position: - position_not_place - | place - ; + position_not_place + | place + ; position_not_place: - expr_pair - | position '+' expr_pair - | position '-' expr_pair - | '(' position ',' position ')' - | expr between position AND position - | expr '<' position ',' position '>' - ; + expr_pair + | position '+' expr_pair + | position '-' expr_pair + | '(' position ',' position ')' + | expr between position AND position + | expr '<' position ',' position '>' + ; between: - BETWEEN - | OF THE WAY BETWEEN - ; + BETWEEN + | OF THE WAY BETWEEN + ; expr_pair: - expr ',' expr - | '(' expr_pair ')' - ; + expr ',' expr + | '(' expr_pair ')' + ; place: - /* line at A left == line (at A) left */ - label %prec CHOP - | label corner - | corner label - | corner OF label - | HERE - ; + /* line at A left == line (at A) left */ + label %prec CHOP + | label corner + | corner label + | corner OF label + | HERE + ; label: - LABEL - | nth_primitive - | label '.' LABEL - ; + LABEL + | nth_primitive + | label '.' LABEL + ; ordinal: - ORDINAL - | '`' any_expr TH - ; + ORDINAL + | '`' any_expr TH + ; optional_ordinal_last: - LAST - | ordinal LAST - ; + LAST + | ordinal LAST + ; nth_primitive: - ordinal object_type - | optional_ordinal_last object_type - ; + ordinal object_type + | optional_ordinal_last object_type + ; object_type: - BOX - | CIRCLE - | ELLIPSE - | ARC - | LINE - | ARROW - | SPLINE - | '[' ']' - | TEXT - ; + BOX + | CIRCLE + | ELLIPSE + | ARC + | LINE + | ARROW + | SPLINE + | '[' ']' + | TEXT + ; label_path: - '.' LABEL - | label_path '.' LABEL - ; + '.' LABEL + | label_path '.' LABEL + ; relative_path: - corner %prec CHOP - /* give this a lower precedence than LEFT and RIGHT so that - [A: box] with .A left == [A: box] with (.A left) */ - | label_path %prec TEXT - | label_path corner - ; + corner %prec CHOP + /* give this a lower precedence than LEFT and RIGHT so that + [A: box] with .A left == [A: box] with (.A left) */ + | label_path %prec TEXT + | label_path corner + ; path: - relative_path - | '(' relative_path ',' relative_path ')' - {} - /* The rest of these rules are a compatibility sop. */ - | ORDINAL LAST object_type relative_path - | LAST object_type relative_path - | ORDINAL object_type relative_path - | LABEL relative_path - ; + relative_path + | '(' relative_path ',' relative_path ')' + {} + /* The rest of these rules are a compatibility sop. */ + | ORDINAL LAST object_type relative_path + | LAST object_type relative_path + | ORDINAL object_type relative_path + | LABEL relative_path + ; corner: - DOT_N - | DOT_E - | DOT_W - | DOT_S - | DOT_NE - | DOT_SE - | DOT_NW - | DOT_SW - | DOT_C - | DOT_START - | DOT_END - | TOP - | BOTTOM - | LEFT - | RIGHT - | UPPER LEFT - | LOWER LEFT - | UPPER RIGHT - | LOWER RIGHT - | LEFT_CORNER - | RIGHT_CORNER - | UPPER LEFT_CORNER - | LOWER LEFT_CORNER - | UPPER RIGHT_CORNER - | LOWER RIGHT_CORNER - | NORTH - | SOUTH - | EAST - | WEST - | CENTER - | START - | END - ; + DOT_N + | DOT_E + | DOT_W + | DOT_S + | DOT_NE + | DOT_SE + | DOT_NW + | DOT_SW + | DOT_C + | DOT_START + | DOT_END + | TOP + | BOTTOM + | LEFT + | RIGHT + | UPPER LEFT + | LOWER LEFT + | UPPER RIGHT + | LOWER RIGHT + | LEFT_CORNER + | RIGHT_CORNER + | UPPER LEFT_CORNER + | LOWER LEFT_CORNER + | UPPER RIGHT_CORNER + | LOWER RIGHT_CORNER + | NORTH + | SOUTH + | EAST + | WEST + | CENTER + | START + | END + ; expr: - VARIABLE - | NUMBER - | place DOT_X - | place DOT_Y - | place DOT_HT - | place DOT_WID - | place DOT_RAD - | expr '+' expr - | expr '-' expr - | expr '*' expr - | expr '/' expr - | expr '%' expr - | expr '^' expr - | '-' expr %prec '!' - | '(' any_expr ')' - | SIN '(' any_expr ')' - | COS '(' any_expr ')' - | ATAN2 '(' any_expr ',' any_expr ')' - | LOG '(' any_expr ')' - | EXP '(' any_expr ')' - | SQRT '(' any_expr ')' - | K_MAX '(' any_expr ',' any_expr ')' - | K_MIN '(' any_expr ',' any_expr ')' - | INT '(' any_expr ')' - | RAND '(' any_expr ')' - | RAND '(' ')' - | SRAND '(' any_expr ')' - | expr '<' expr - | expr LESSEQUAL expr - | expr '>' expr - | expr GREATEREQUAL expr - | expr EQUALEQUAL expr - | expr NOTEQUAL expr - | expr ANDAND expr - | expr OROR expr - | '!' expr - ; + VARIABLE + | NUMBER + | place DOT_X + | place DOT_Y + | place DOT_HT + | place DOT_WID + | place DOT_RAD + | expr '+' expr + | expr '-' expr + | expr '*' expr + | expr '/' expr + | expr '%' expr + | expr '^' expr + | '-' expr %prec '!' + | '(' any_expr ')' + | SIN '(' any_expr ')' + | COS '(' any_expr ')' + | ATAN2 '(' any_expr ',' any_expr ')' + | LOG '(' any_expr ')' + | EXP '(' any_expr ')' + | SQRT '(' any_expr ')' + | K_MAX '(' any_expr ',' any_expr ')' + | K_MIN '(' any_expr ',' any_expr ')' + | INT '(' any_expr ')' + | RAND '(' any_expr ')' + | RAND '(' ')' + | SRAND '(' any_expr ')' + | expr '<' expr + | expr LESSEQUAL expr + | expr '>' expr + | expr GREATEREQUAL expr + | expr EQUALEQUAL expr + | expr NOTEQUAL expr + | expr ANDAND expr + | expr OROR expr + | '!' expr + ; ]], dnl INPUT @@ -1951,7 +2009,93 @@ dnl without being followed by "of".) [[VARIABLE, '=', LABEL, LEFT, DOT_X]], dnl BISON-STDERR -[[input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path +[[input.y:202.19: warning: empty rule without %empty [-Wempty-rule] +input.y:270.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.12: warning: empty rule without %empty [-Wempty-rule] +input.y:309.17: warning: empty rule without %empty [-Wempty-rule] +input.y:382.13: warning: empty rule without %empty [-Wempty-rule] +input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] +input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] +input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] +input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] +input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] +input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] +input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] +input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] +input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for '`', use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for '@<:@', use %precedence [-Wprecedence] +input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] +input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] ]], dnl LAST-STATE