# Exercising Bison on actual grammars. -*- Autotest -*-
-# Copyright (C) 1989-1992, 2000-2005, 2007, 2009-2011 Free Software
+# Copyright (C) 1989-1992, 2000-2005, 2007, 2009-2013 Free Software
# Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
dnl support is rapidly evolving, let's keep that information to be careful.
dnl However, we don't do diffs for canonical LR(1) because the diff is huge.
m4_pushdef([AT_LALR1_DIFF_CHECK],
-[AT_CHECK([[sed 's/^%define lr.type .*$//' input.y > input-lalr.y]])
+[dnl We need diff -u, which is not portable.
+AT_CHECK([diff -u /dev/null /dev/null || exit 77], [0], [ignore])
+
+AT_CHECK([[sed 's/^%define lr.type .*$//' input.y > input-lalr.y]])
AT_BISON_CHECK([[--report=all input-lalr.y]], [[0]], [ignore], [ignore])
AT_CHECK([[diff -u input-lalr.output input.output \
| sed -n '/^@@/,$p' | sed 's/^ $//']],
]],
[[
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
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]
+input.y: warning: 265 shift/reduce conflicts [-Wconflicts-sr]
+input.y:19.8-16: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence]
+input.y:21.8-14: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence]
+input.y:21.16-22: warning: useless associativity for YSTRING, use %precedence [-Wprecedence]
+input.y:22.14-22: warning: useless precedence and associativity for APPEND_OP [-Wprecedence]
+input.y:23.8-15: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence]
+input.y:23.33-41: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence]
+input.y:27.8-18: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence]
+input.y:28.8-13: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence]
+input.y:29.23-31: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence]
+input.y:29.33-41: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence]
+input.y:30.8-18: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence]
+input.y:30.20-29: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence]
+input.y:40.11-13: warning: useless precedence and associativity for ',' [-Wprecedence]
+input.y:47.8-10: warning: useless associativity for '!', use %precedence [-Wprecedence]
+input.y:47.12-16: warning: useless associativity for UNARY, use %precedence [-Wprecedence]
+input.y:50.7-9: warning: useless associativity for '$', use %precedence [-Wprecedence]
+input.y:51.7-9: warning: useless associativity for '(', use %precedence [-Wprecedence]
+input.y:51.11-13: warning: useless precedence and associativity for ')' [-Wprecedence]]],
+[[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]
+input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr]
+input.y:19.8-16: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence]
+input.y:21.8-14: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence]
+input.y:21.16-22: warning: useless associativity for YSTRING, use %precedence [-Wprecedence]
+input.y:22.14-22: warning: useless precedence and associativity for APPEND_OP [-Wprecedence]
+input.y:23.8-15: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence]
+input.y:23.33-41: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence]
+input.y:27.8-18: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence]
+input.y:28.8-13: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence]
+input.y:29.23-31: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence]
+input.y:29.33-41: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence]
+input.y:30.8-18: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence]
+input.y:30.20-29: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence]
+input.y:40.11-13: warning: useless precedence and associativity for ',' [-Wprecedence]
+input.y:47.8-10: warning: useless associativity for '!', use %precedence [-Wprecedence]
+input.y:47.12-16: warning: useless associativity for UNARY, use %precedence [-Wprecedence]
+input.y:50.7-9: warning: useless associativity for '$', use %precedence [-Wprecedence]
+input.y:51.7-9: warning: useless associativity for '(', use %precedence [-Wprecedence]
+input.y:51.11-13: warning: useless precedence and associativity for ')' [-Wprecedence]]])[
]],
dnl LAST-STATE
$default reduce using rule 45 (statement)
+
+
-+state 320
++State 320
+
+ 139 non_post_simp_exp: . '!' simp_exp
+ 140 | . '(' exp r_paren
+ variable go to state 63
+
+
-+state 321
++State 321
+
+ 146 non_post_simp_exp: INCREMENT . variable
+ 154 variable: . NAME
+ variable go to state 50
+
+
-+state 322
++State 322
+
+ 147 non_post_simp_exp: DECREMENT . variable
+ 154 variable: . NAME
+ variable go to state 51
+
+
-+state 323
++State 323
+
+ 130 simp_exp: . non_post_simp_exp
+ 131 | . simp_exp '^' simp_exp
+ variable go to state 57
+
+
-+state 324
++State 324
+
+ 130 simp_exp: . non_post_simp_exp
+ 131 | . simp_exp '^' simp_exp
+ variable go to state 57
+
+
-+state 325
++State 325
+
+ 130 simp_exp: . non_post_simp_exp
+ 131 | . simp_exp '^' simp_exp
+ variable go to state 57
+
+
-+state 326
++State 326
+
+ 131 simp_exp: simp_exp . '^' simp_exp
+ 132 | simp_exp . '*' simp_exp
+ Conflict between rule 151 and token '-' resolved as reduce ('-' < UNARY).
+
+
-+state 327
++State 327
+
+ 131 simp_exp: simp_exp . '^' simp_exp
+ 132 | simp_exp . '*' simp_exp
+ Conflict between rule 150 and token '-' resolved as reduce ('-' < UNARY).
+
+
-+state 328
++State 328
+
+ 131 simp_exp: simp_exp . '^' simp_exp
+ 132 | simp_exp . '*' simp_exp
# It reported 80 SR && 99 RR conflicts instead of 78/10!!!
AT_TEST_EXISTING_GRAMMAR([[GNU Cim Grammar]],
-[[%union {}
-
+[[
%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
%left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR
-%left HCONC
+%left HCONC
%left HTERMOPERATOR
%left UNEAR
[[
/* 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]
+input.y: warning: 1876 shift/reduce conflicts [-Wconflicts-sr]
+input.y: warning: 144 reduce/reduce conflicts [-Wconflicts-rr]
+input.y:32.9-12: warning: useless associativity for HQUA, use %precedence [-Wprecedence]
+input.y:53.8-14: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence]
+input.y:54.9-15: warning: useless associativity for HORELSE, use %precedence [-Wprecedence]
+input.y:55.9-16: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence]
+input.y:61.9-12: warning: useless associativity for HNOT, use %precedence [-Wprecedence]
+input.y:68.7-11: warning: useless associativity for UNEAR, use %precedence [-Wprecedence]]],
+[[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]
+input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr]
+input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr]
+input.y:32.9-12: warning: useless associativity for HQUA, use %precedence [-Wprecedence]
+input.y:53.8-14: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence]
+input.y:54.9-15: warning: useless associativity for HORELSE, use %precedence [-Wprecedence]
+input.y:55.9-16: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence]
+input.y:61.9-12: warning: useless associativity for HNOT, use %precedence [-Wprecedence]
+input.y:68.7-11: warning: useless associativity for UNEAR, use %precedence [-Wprecedence]]])[
]],
dnl LAST-STATE
AT_TEST_EXISTING_GRAMMAR([[GNU pic (Groff 1.18.1) Grammar]],
[[%error-verbose
-%union {}
%token LABEL
%token VARIABLE
%token RAND
%token SRAND
%token COPY
-%token THRU
+%token THROUGH
%token TOP
%token BOTTOM
%token UPPER
%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
/* 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
]],
[[
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 THRU
- {}
- DELIMITED
- {}
- until
- | COPY THRU
- {}
- 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
[[VARIABLE, '=', LABEL, LEFT, DOT_X]],
dnl BISON-STDERR
-[[input.y:471.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:19.8-12: warning: useless associativity for LABEL, use %precedence [-Wprecedence]
+input.y:20.8-15: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence]
+input.y:21.8-13: warning: useless associativity for NUMBER, use %precedence [-Wprecedence]
+input.y:22.8-11: warning: useless associativity for TEXT, use %precedence [-Wprecedence]
+input.y:25.8-14: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence]
+input.y:30.8-11: warning: useless associativity for LAST, use %precedence [-Wprecedence]
+input.y:31.8-9: warning: useless associativity for UP, use %precedence [-Wprecedence]
+input.y:32.8-11: warning: useless associativity for DOWN, use %precedence [-Wprecedence]
+input.y:35.8-10: warning: useless associativity for BOX, use %precedence [-Wprecedence]
+input.y:36.8-13: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence]
+input.y:37.8-14: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence]
+input.y:38.8-10: warning: useless associativity for ARC, use %precedence [-Wprecedence]
+input.y:39.8-11: warning: useless associativity for LINE, use %precedence [-Wprecedence]
+input.y:40.8-12: warning: useless associativity for ARROW, use %precedence [-Wprecedence]
+input.y:42.8-13: warning: useless associativity for SPLINE, use %precedence [-Wprecedence]
+input.y:43.8-13: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence]
+input.y:44.8-13: warning: useless associativity for RADIUS, use %precedence [-Wprecedence]
+input.y:45.8-12: warning: useless associativity for WIDTH, use %precedence [-Wprecedence]
+input.y:46.8-15: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence]
+input.y:47.8-11: warning: useless associativity for FROM, use %precedence [-Wprecedence]
+input.y:48.8-9: warning: useless associativity for TO, use %precedence [-Wprecedence]
+input.y:49.8-9: warning: useless associativity for AT, use %precedence [-Wprecedence]
+input.y:53.8-12: warning: useless precedence and associativity for SOLID [-Wprecedence]
+input.y:54.8-13: warning: useless associativity for DOTTED, use %precedence [-Wprecedence]
+input.y:55.8-13: warning: useless associativity for DASHED, use %precedence [-Wprecedence]
+input.y:56.8-11: warning: useless associativity for CHOP, use %precedence [-Wprecedence]
+input.y:59.8-12: warning: useless precedence and associativity for LJUST [-Wprecedence]
+input.y:60.8-12: warning: useless precedence and associativity for RJUST [-Wprecedence]
+input.y:61.8-12: warning: useless precedence and associativity for ABOVE [-Wprecedence]
+input.y:62.8-12: warning: useless precedence and associativity for BELOW [-Wprecedence]
+input.y:63.8-9: warning: useless associativity for OF, use %precedence [-Wprecedence]
+input.y:66.8-14: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence]
+input.y:67.8-10: warning: useless associativity for AND, use %precedence [-Wprecedence]
+input.y:68.8-11: warning: useless associativity for HERE, use %precedence [-Wprecedence]
+input.y:69.8-12: warning: useless associativity for DOT_N, use %precedence [-Wprecedence]
+input.y:70.8-12: warning: useless associativity for DOT_E, use %precedence [-Wprecedence]
+input.y:71.8-12: warning: useless associativity for DOT_W, use %precedence [-Wprecedence]
+input.y:72.8-12: warning: useless associativity for DOT_S, use %precedence [-Wprecedence]
+input.y:73.8-13: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence]
+input.y:74.8-13: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence]
+input.y:75.8-13: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence]
+input.y:76.8-13: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence]
+input.y:77.8-12: warning: useless associativity for DOT_C, use %precedence [-Wprecedence]
+input.y:78.8-16: warning: useless associativity for DOT_START, use %precedence [-Wprecedence]
+input.y:79.8-14: warning: useless associativity for DOT_END, use %precedence [-Wprecedence]
+input.y:85.8-10: warning: useless associativity for SIN, use %precedence [-Wprecedence]
+input.y:86.8-10: warning: useless associativity for COS, use %precedence [-Wprecedence]
+input.y:87.8-12: warning: useless associativity for ATAN2, use %precedence [-Wprecedence]
+input.y:88.8-10: warning: useless associativity for LOG, use %precedence [-Wprecedence]
+input.y:89.8-10: warning: useless associativity for EXP, use %precedence [-Wprecedence]
+input.y:90.8-11: warning: useless associativity for SQRT, use %precedence [-Wprecedence]
+input.y:91.8-12: warning: useless associativity for K_MAX, use %precedence [-Wprecedence]
+input.y:92.8-12: warning: useless associativity for K_MIN, use %precedence [-Wprecedence]
+input.y:93.8-10: warning: useless associativity for INT, use %precedence [-Wprecedence]
+input.y:94.8-11: warning: useless associativity for RAND, use %precedence [-Wprecedence]
+input.y:95.8-12: warning: useless associativity for SRAND, use %precedence [-Wprecedence]
+input.y:98.8-10: warning: useless associativity for TOP, use %precedence [-Wprecedence]
+input.y:99.8-13: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence]
+input.y:100.8-12: warning: useless associativity for UPPER, use %precedence [-Wprecedence]
+input.y:101.8-12: warning: useless associativity for LOWER, use %precedence [-Wprecedence]
+input.y:116.8-18: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence]
+input.y:117.8-19: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence]
+input.y:118.8-12: warning: useless associativity for NORTH, use %precedence [-Wprecedence]
+input.y:119.8-12: warning: useless associativity for SOUTH, use %precedence [-Wprecedence]
+input.y:120.8-11: warning: useless associativity for EAST, use %precedence [-Wprecedence]
+input.y:121.8-11: warning: useless associativity for WEST, use %precedence [-Wprecedence]
+input.y:122.8-13: warning: useless associativity for CENTER, use %precedence [-Wprecedence]
+input.y:123.8-10: warning: useless associativity for END, use %precedence [-Wprecedence]
+input.y:124.8-12: warning: useless associativity for START, use %precedence [-Wprecedence]
+input.y:127.8-11: warning: useless associativity for PLOT, use %precedence [-Wprecedence]
+input.y:128.8-16: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence]
+input.y:129.8-11: warning: useless associativity for FILL, use %precedence [-Wprecedence]
+input.y:130.8-14: warning: useless precedence and associativity for COLORED [-Wprecedence]
+input.y:131.8-15: warning: useless precedence and associativity for OUTLINED [-Wprecedence]
+input.y:134.8-14: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence]
+input.y:137.7-9: warning: useless associativity for '.', use %precedence [-Wprecedence]
+input.y:156.23-25: warning: useless associativity for '(', use %precedence [-Wprecedence]
+input.y:157.20-22: warning: useless associativity for '`', use %precedence [-Wprecedence]
+input.y:159.48-50: warning: useless associativity for '@<:@', use %precedence [-Wprecedence]
+input.y:170.7-9: warning: useless associativity for ',', use %precedence [-Wprecedence]
+input.y:181.8-10: warning: useless associativity for '!', use %precedence [-Wprecedence]
]],
dnl LAST-STATE
nth_primitive go to state 105
@@ -3256,7 +3256,7 @@
- state 102
+ State 102
- 146 place: label . [$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, AND, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '`', ',', '>', '+', '-', '!', ';', '}', '@:>@', ')']
+ 146 place: label . [$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '`', '+', '-', '!', ';', '}', '@:>@']
+ expr go to state 424
- state 165
+ State 165
@@ -7987,7 +7987,7 @@
text_expr go to state 112
text go to state 113
+ between go to state 425
- state 193
+ State 193
@@ -10152,7 +10152,7 @@
expr_pair go to state 317
+ expr go to state 424
- state 238
+ State 238
@@ -12937,7 +12937,7 @@
'!' shift, and go to state 94
+ expr go to state 424
- state 315
+ State 315
@@ -16124,7 +16124,7 @@
$default reduce using rule 239 (expr)
+ expr go to state 424
- state 383
+ State 383
@@ -18071,7 +18071,7 @@
'!' shift, and go to state 94
$default reduce using rule 29 (placeless_element)
+
+
-+state 423
++State 423
+
+ 146 place: label . [$end, AND, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, ',', '>', '+', '-', ';', '}', '@:>@', ')']
+ 147 | label . corner
+ corner go to state 205
+
+
-+state 424
++State 424
+
+ 140 position_not_place: expr . between position AND position
+ 141 | expr . '<' position ',' position '>'
+ between go to state 425
+
+
-+state 425
++State 425
+
+ 134 position: . position_not_place
+ 135 | . place
+ expr go to state 424
+
+
-+state 426
++State 426
+
+ 137 position_not_place: position . '+' expr_pair
+ 138 | position . '-' expr_pair
+ '-' shift, and go to state 198
+
+
-+state 427
++State 427
+
+ 134 position: . position_not_place
+ 135 | . place