]> git.saurik.com Git - bison.git/blobdiff - tests/existing.at
regen.
[bison.git] / tests / existing.at
index 27ba3123511da28a85a7c12f818cd5585c199569..a34f92380fca2af1a06e01000b149c9ac5930cd8 100644 (file)
@@ -1,39 +1,80 @@
 # Exercising Bison on actual grammars.                   -*- Autotest -*-
 
 # Exercising Bison on actual grammars.                   -*- Autotest -*-
 
-# Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004
-# Free Software Foundation, Inc.
+# Copyright (C) 1989-1992, 2000-2005, 2007, 2009-2012 Free Software
+# Foundation, Inc.
 
 
-# This program is free software; you can redistribute it and/or modify
+# This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-
+#
 # You should have received a copy of the GNU General Public License
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 AT_BANNER([[Existing Grammars.]])
 
 AT_BANNER([[Existing Grammars.]])
-## ----------------- ##
-## GNU AWK Grammar.  ##
-## ----------------- ##
 
 
-AT_SETUP([GNU AWK Grammar])
+# AT_TEST_EXISTING_GRAMMAR(DESCRIPTION,
+#                          DECLS, GRAMMAR, INPUT,
+#                          BISON-STDERR, LAST-STATE, LALR1-DIFF,
+#                          [OTHER-CHECKS],
+#                          [PARSER-EXIT-VALUE],
+#                          [PARSER-STDOUT], [PARSER-STDERR])
+# --------------------------------------------------------------
+m4_define([AT_TEST_EXISTING_GRAMMAR], [_AT_TEST_EXISTING_GRAMMAR([$][1], $@)])
+
+m4_define([_AT_TEST_EXISTING_GRAMMAR],
+[
+dnl See how the parser tables have changed.  As the .output format evolves, the
+dnl diff comments with line numbers might be a pain to maintain.  When that
+dnl time comes, just use sed to drop the line numbers.  For now, as LR(1)
+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]])
+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/^ $//']],
+         [[0]], [$1])])
+
+AT_TEST_TABLES_AND_PARSE([$2[: LALR(1)]], [[LALR]], [[last-state]],
+                         [[%define lr.type lalr
+]$3],
+                         [$4], [$5], [$6], [$7],
+                         [AT_LALR1_DIFF_CHECK([$8])$9], [$10], [$11], [$12])
+AT_TEST_TABLES_AND_PARSE([$2[: IELR(1)]], [[IELR]], [[last-state]],
+                         [[%define lr.type ielr
+]$3],
+                         [$4], [$5], [$6], [$7],
+                         [AT_LALR1_DIFF_CHECK([$8])$9], [$10], [$11], [$12])
+AT_TEST_TABLES_AND_PARSE([$2[: Canonical LR(1)]], [[canonical LR]],
+                         [[last-state,no-xml]],
+                         [[%define lr.type canonical-lr
+]$3],
+                         [$4], [$5], [$6], [$7],
+                         [$9], [$10], [$11], [$12])
+
+m4_popdef([AT_LALR1_DIFF_CHECK])
+])
+
+
+
+## ----------------------- ##
+## GNU AWK 3.1.0 Grammar.  ##
+## ----------------------- ##
 
 # We have been careful to strip all the actions excepts the
 
 # We have been careful to strip all the actions excepts the
-# mid-rule actions.  We rely on %expect to check that there are
-# indeed 65 SR conflicts.
+# mid-rule actions.
 #
 #
-# Bison was once wrong, due to an incorrect computation of nullable.
-# It reported 485 SR conflicts!
+# There are 65 SR conflicts.  Bison was once wrong, due to an incorrect
+# computation of nullable.  It reported 485 SR conflicts!
 
 
-AT_DATA([[input.y]],
-[[%expect 65
+AT_TEST_EXISTING_GRAMMAR([[GNU AWK 3.1.0 Grammar]],
+[[%error-verbose
 
 %token FUNC_CALL NAME REGEXP
 %token ERROR
 
 %token FUNC_CALL NAME REGEXP
 %token ERROR
@@ -68,8 +109,8 @@ AT_DATA([[input.y]],
 %left INCREMENT DECREMENT
 %left '$'
 %left '(' ')'
 %left INCREMENT DECREMENT
 %left '$'
 %left '(' ')'
-%%
-
+]],
+[[
 start
        : opt_nls program opt_nls
        ;
 start
        : opt_nls program opt_nls
        ;
@@ -113,7 +154,6 @@ function_body
        | l_brace r_brace opt_semi opt_nls
        ;
 
        | l_brace r_brace opt_semi opt_nls
        ;
 
-
 pattern
        : exp
        | exp ',' exp
 pattern
        : exp
        | exp ',' exp
@@ -347,81 +387,434 @@ semi
 
 comma  : ',' opt_nls
        ;
 
 comma  : ',' opt_nls
        ;
-
-%%
-]])
-
-# Pass plenty of options, to exercise plenty of code, even if we
-# don't actually check the output.  But SEGV is watching us, and
-# so might do dmalloc.
-AT_CHECK([[bison --verbose --defines input.y]])
-
-AT_CLEANUP
-
+]],
+
+dnl INPUT
+dnl
+dnl For example, in AWK:
+dnl
+dnl   getline $!4*0;
+dnl
+dnl The grammar below (from GNU AWK 3.1.0) using canonical LR(1) or IELR(1)
+dnl parses it as:
+dnl
+dnl   getline $!(4*0);
+dnl
+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
+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 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;'.
+[[LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';']],
+
+dnl BISON-STDERR
+[AT_COND_CASE([[canonical LR]],
+[[input.y: conflicts: 265 shift/reduce]],
+[[input.y: conflicts: 65 shift/reduce]])[
+]],
+
+dnl LAST-STATE
+[AT_COND_CASE([[LALR]], [[319]], [[canonical LR]], [[2358]], [[328]])],
+
+dnl LALR1-DIFF not used for canonical LR(1) because the diff is huge.
+dnl Isocore map from LALR(1) state number to new state number plus descriptions
+dnl of any change in the actions resulting in a change in accepted language:
+dnl   - 24 -> 320
+dnl   - 16 -> 321
+dnl   - 17 -> 322
+dnl   - 20 -> 323
+dnl   - 21 -> 324
+dnl   - 54 -> 325
+dnl   - 56 -> 326: reduce -> shift on '*', '/', and '%'
+dnl   - 58 -> 327: reduce -> shift on '*', '/', and '%'
+dnl   - 61 -> 328: reduce -> shift on '*', '/', and '%'
+[AT_COND_CASE([[LALR]], [],
+[[@@ -712,7 +712,7 @@
+   156         | . '$' non_post_simp_exp
+
+     NAME  shift, and go to state 9
+-    '$'   shift, and go to state 24
++    '$'   shift, and go to state 320
+
+     NAME      [reduce using rule 152 (opt_variable)]
+     '$'       [reduce using rule 152 (opt_variable)]
+@@ -5379,7 +5379,7 @@
+   156         | . '$' non_post_simp_exp
+
+     NAME  shift, and go to state 9
+-    '$'   shift, and go to state 24
++    '$'   shift, and go to state 320
+
+     NAME      [reduce using rule 152 (opt_variable)]
+     '$'       [reduce using rule 152 (opt_variable)]
+@@ -5399,7 +5399,7 @@
+   156         | . '$' non_post_simp_exp
+
+     NAME  shift, and go to state 9
+-    '$'   shift, and go to state 24
++    '$'   shift, and go to state 320
+
+     NAME      [reduce using rule 152 (opt_variable)]
+     '$'       [reduce using rule 152 (opt_variable)]
+@@ -6214,7 +6214,7 @@
+   156         | . '$' non_post_simp_exp
+
+     NAME  shift, and go to state 9
+-    '$'   shift, and go to state 24
++    '$'   shift, and go to state 320
+
+     NAME      [reduce using rule 152 (opt_variable)]
+     '$'       [reduce using rule 152 (opt_variable)]
+@@ -11099,3 +11099,274 @@
+    45 statement: LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement .
+
+     $default  reduce using rule 45 (statement)
++
++
++state 320
++
++  139 non_post_simp_exp: . '!' simp_exp
++  140                  | . '(' exp r_paren
++  141                  | . LEX_BUILTIN '(' opt_expression_list r_paren
++  142                  | . LEX_LENGTH '(' opt_expression_list r_paren
++  143                  | . LEX_LENGTH
++  144                  | . FUNC_CALL '(' opt_expression_list r_paren
++  145                  | . variable
++  146                  | . INCREMENT variable
++  147                  | . DECREMENT variable
++  148                  | . YNUMBER
++  149                  | . YSTRING
++  150                  | . '-' simp_exp
++  151                  | . '+' simp_exp
++  154 variable: . NAME
++  155         | . NAME '[' expression_list ']'
++  156         | . '$' non_post_simp_exp
++  156         | '$' . non_post_simp_exp
++
++    FUNC_CALL    shift, and go to state 8
++    NAME         shift, and go to state 9
++    YNUMBER      shift, and go to state 10
++    YSTRING      shift, and go to state 11
++    INCREMENT    shift, and go to state 321
++    DECREMENT    shift, and go to state 322
++    LEX_BUILTIN  shift, and go to state 18
++    LEX_LENGTH   shift, and go to state 19
++    '+'          shift, and go to state 323
++    '-'          shift, and go to state 324
++    '!'          shift, and go to state 325
++    '$'          shift, and go to state 320
++    '('          shift, and go to state 55
++
++    non_post_simp_exp  go to state 62
++    variable           go to state 63
++
++
++state 321
++
++  146 non_post_simp_exp: INCREMENT . variable
++  154 variable: . NAME
++  155         | . NAME '[' expression_list ']'
++  156         | . '$' non_post_simp_exp
++
++    NAME  shift, and go to state 9
++    '$'   shift, and go to state 320
++
++    variable  go to state 50
++
++
++state 322
++
++  147 non_post_simp_exp: DECREMENT . variable
++  154 variable: . NAME
++  155         | . NAME '[' expression_list ']'
++  156         | . '$' non_post_simp_exp
++
++    NAME  shift, and go to state 9
++    '$'   shift, and go to state 320
++
++    variable  go to state 51
++
++
++state 323
++
++  130 simp_exp: . non_post_simp_exp
++  131         | . simp_exp '^' simp_exp
++  132         | . simp_exp '*' simp_exp
++  133         | . simp_exp '/' simp_exp
++  134         | . simp_exp '%' simp_exp
++  135         | . simp_exp '+' simp_exp
++  136         | . simp_exp '-' simp_exp
++  137         | . variable INCREMENT
++  138         | . variable DECREMENT
++  139 non_post_simp_exp: . '!' simp_exp
++  140                  | . '(' exp r_paren
++  141                  | . LEX_BUILTIN '(' opt_expression_list r_paren
++  142                  | . LEX_LENGTH '(' opt_expression_list r_paren
++  143                  | . LEX_LENGTH
++  144                  | . FUNC_CALL '(' opt_expression_list r_paren
++  145                  | . variable
++  146                  | . INCREMENT variable
++  147                  | . DECREMENT variable
++  148                  | . YNUMBER
++  149                  | . YSTRING
++  150                  | . '-' simp_exp
++  151                  | . '+' simp_exp
++  151                  | '+' . simp_exp
++  154 variable: . NAME
++  155         | . NAME '[' expression_list ']'
++  156         | . '$' non_post_simp_exp
++
++    FUNC_CALL    shift, and go to state 8
++    NAME         shift, and go to state 9
++    YNUMBER      shift, and go to state 10
++    YSTRING      shift, and go to state 11
++    INCREMENT    shift, and go to state 16
++    DECREMENT    shift, and go to state 17
++    LEX_BUILTIN  shift, and go to state 18
++    LEX_LENGTH   shift, and go to state 19
++    '+'          shift, and go to state 20
++    '-'          shift, and go to state 21
++    '!'          shift, and go to state 54
++    '$'          shift, and go to state 24
++    '('          shift, and go to state 55
++
++    simp_exp           go to state 326
++    non_post_simp_exp  go to state 35
++    variable           go to state 57
++
++
++state 324
++
++  130 simp_exp: . non_post_simp_exp
++  131         | . simp_exp '^' simp_exp
++  132         | . simp_exp '*' simp_exp
++  133         | . simp_exp '/' simp_exp
++  134         | . simp_exp '%' simp_exp
++  135         | . simp_exp '+' simp_exp
++  136         | . simp_exp '-' simp_exp
++  137         | . variable INCREMENT
++  138         | . variable DECREMENT
++  139 non_post_simp_exp: . '!' simp_exp
++  140                  | . '(' exp r_paren
++  141                  | . LEX_BUILTIN '(' opt_expression_list r_paren
++  142                  | . LEX_LENGTH '(' opt_expression_list r_paren
++  143                  | . LEX_LENGTH
++  144                  | . FUNC_CALL '(' opt_expression_list r_paren
++  145                  | . variable
++  146                  | . INCREMENT variable
++  147                  | . DECREMENT variable
++  148                  | . YNUMBER
++  149                  | . YSTRING
++  150                  | . '-' simp_exp
++  150                  | '-' . simp_exp
++  151                  | . '+' simp_exp
++  154 variable: . NAME
++  155         | . NAME '[' expression_list ']'
++  156         | . '$' non_post_simp_exp
++
++    FUNC_CALL    shift, and go to state 8
++    NAME         shift, and go to state 9
++    YNUMBER      shift, and go to state 10
++    YSTRING      shift, and go to state 11
++    INCREMENT    shift, and go to state 16
++    DECREMENT    shift, and go to state 17
++    LEX_BUILTIN  shift, and go to state 18
++    LEX_LENGTH   shift, and go to state 19
++    '+'          shift, and go to state 20
++    '-'          shift, and go to state 21
++    '!'          shift, and go to state 54
++    '$'          shift, and go to state 24
++    '('          shift, and go to state 55
++
++    simp_exp           go to state 327
++    non_post_simp_exp  go to state 35
++    variable           go to state 57
++
++
++state 325
++
++  130 simp_exp: . non_post_simp_exp
++  131         | . simp_exp '^' simp_exp
++  132         | . simp_exp '*' simp_exp
++  133         | . simp_exp '/' simp_exp
++  134         | . simp_exp '%' simp_exp
++  135         | . simp_exp '+' simp_exp
++  136         | . simp_exp '-' simp_exp
++  137         | . variable INCREMENT
++  138         | . variable DECREMENT
++  139 non_post_simp_exp: . '!' simp_exp
++  139                  | '!' . simp_exp
++  140                  | . '(' exp r_paren
++  141                  | . LEX_BUILTIN '(' opt_expression_list r_paren
++  142                  | . LEX_LENGTH '(' opt_expression_list r_paren
++  143                  | . LEX_LENGTH
++  144                  | . FUNC_CALL '(' opt_expression_list r_paren
++  145                  | . variable
++  146                  | . INCREMENT variable
++  147                  | . DECREMENT variable
++  148                  | . YNUMBER
++  149                  | . YSTRING
++  150                  | . '-' simp_exp
++  151                  | . '+' simp_exp
++  154 variable: . NAME
++  155         | . NAME '[' expression_list ']'
++  156         | . '$' non_post_simp_exp
++
++    FUNC_CALL    shift, and go to state 8
++    NAME         shift, and go to state 9
++    YNUMBER      shift, and go to state 10
++    YSTRING      shift, and go to state 11
++    INCREMENT    shift, and go to state 16
++    DECREMENT    shift, and go to state 17
++    LEX_BUILTIN  shift, and go to state 18
++    LEX_LENGTH   shift, and go to state 19
++    '+'          shift, and go to state 20
++    '-'          shift, and go to state 21
++    '!'          shift, and go to state 54
++    '$'          shift, and go to state 24
++    '('          shift, and go to state 55
++
++    simp_exp           go to state 328
++    non_post_simp_exp  go to state 35
++    variable           go to state 57
++
++
++state 326
++
++  131 simp_exp: simp_exp . '^' simp_exp
++  132         | simp_exp . '*' simp_exp
++  133         | simp_exp . '/' simp_exp
++  134         | simp_exp . '%' simp_exp
++  135         | simp_exp . '+' simp_exp
++  136         | simp_exp . '-' simp_exp
++  151 non_post_simp_exp: '+' simp_exp .  [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '$', '(', ')', '@:>@', '{', ';']
++
++    '*'  shift, and go to state 89
++    '/'  shift, and go to state 90
++    '%'  shift, and go to state 91
++    '^'  shift, and go to state 92
++
++    $default  reduce using rule 151 (non_post_simp_exp)
++
++    Conflict between rule 151 and token '+' resolved as reduce ('+' < UNARY).
++    Conflict between rule 151 and token '-' resolved as reduce ('-' < UNARY).
++
++
++state 327
++
++  131 simp_exp: simp_exp . '^' simp_exp
++  132         | simp_exp . '*' simp_exp
++  133         | simp_exp . '/' simp_exp
++  134         | simp_exp . '%' simp_exp
++  135         | simp_exp . '+' simp_exp
++  136         | simp_exp . '-' simp_exp
++  150 non_post_simp_exp: '-' simp_exp .  [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '$', '(', ')', '@:>@', '{', ';']
++
++    '*'  shift, and go to state 89
++    '/'  shift, and go to state 90
++    '%'  shift, and go to state 91
++    '^'  shift, and go to state 92
++
++    $default  reduce using rule 150 (non_post_simp_exp)
++
++    Conflict between rule 150 and token '+' resolved as reduce ('+' < UNARY).
++    Conflict between rule 150 and token '-' resolved as reduce ('-' < UNARY).
++
++
++state 328
++
++  131 simp_exp: simp_exp . '^' simp_exp
++  132         | simp_exp . '*' simp_exp
++  133         | simp_exp . '/' simp_exp
++  134         | simp_exp . '%' simp_exp
++  135         | simp_exp . '+' simp_exp
++  136         | simp_exp . '-' simp_exp
++  139 non_post_simp_exp: '!' simp_exp .  [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '$', '(', ')', '@:>@', '{', ';']
++
++    '*'  shift, and go to state 89
++    '/'  shift, and go to state 90
++    '%'  shift, and go to state 91
++    '^'  shift, and go to state 92
++
++    $default  reduce using rule 139 (non_post_simp_exp)
++
++    Conflict between rule 139 and token '+' resolved as reduce ('+' < UNARY).
++    Conflict between rule 139 and token '-' resolved as reduce ('-' < UNARY).
+]])],
+
+dnl OTHER-CHECKS
+[],
+
+dnl PARSER-EXIT-VALUE, PARSER-STDOUT, PARSER-STDERR
+dnl In the case of the syntax error, the parser recovers, so it returns 0.
+[[0]],
+[],
+[AT_COND_CASE([[LALR]],
+[[syntax error, unexpected '*', expecting NEWLINE or '{' or ';'
+]])])
 
 ## ----------------- ##
 ## GNU Cim Grammar.  ##
 ## ----------------- ##
 
 
 ## ----------------- ##
 ## GNU Cim Grammar.  ##
 ## ----------------- ##
 
-AT_SETUP([GNU Cim Grammar])
-
 # GNU Cim, the GNU Simula 87 Compiler.
 
 # Bison was once wrong, due to an incorrect computation of the RR conflicts.
 # It reported 80 SR && 99 RR conflicts instead of 78/10!!!
 
 # GNU Cim, the GNU Simula 87 Compiler.
 
 # Bison was once wrong, due to an incorrect computation of the RR conflicts.
 # It reported 80 SR && 99 RR conflicts instead of 78/10!!!
 
-AT_DATA([[input.y]],
-[[%union {
-       long int token;
-       long int ival;
-       long int arrdim;
-       double rval;
-       char *ident;
-       char *tval;
-       char stat_decl;
-       }
-
+AT_TEST_EXISTING_GRAMMAR([[GNU Cim Grammar]],
+[[
 %token
 %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
+       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
 
        HDOTDOTDOT
 
-%token <ident> HIDENTIFIER
-%token <ival> HBOOLEANKONST HINTEGERKONST HCHARACTERKONST
-%token <rval> HREALKONST
-%token <tval> HTEXTKONST
+%token HIDENTIFIER
+%token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST
+%token HREALKONST
+%token HTEXTKONST
 
 
-%type <tval> EXT_IDENT
-%type <stat_decl> DECLSTATEMENT MODULSTATEMENT MBEE_DECLSTMS MBEE_DECLSTMSU
-%type <stat_decl> MODULS
-%type <ident> EXPRESSION_SIMP MBEE_ARG_R_PT
-%type <arrdim> BAUND_PAIR_LIST
 
 
-%right <token> HASSIGN
+%right HASSIGN
 %left   HORELSE
 %left   HANDTHEN
 %left   HEQV
 %left   HORELSE
 %left   HANDTHEN
 %left   HEQV
@@ -431,13 +824,13 @@ AT_DATA([[input.y]],
 
 %left   HNOT
 
 
 %left   HNOT
 
-%left <token> HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR
+%left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR
 
 %left  HCONC
 
 
 %left  HCONC
 
-%left <token> HTERMOPERATOR
-%left <token> UNEAR
-%left <token> HFACTOROPERATOR
+%left HTERMOPERATOR
+%left UNEAR
+%left HFACTOROPERATOR
 %left         HPRIMARYOPERATOR
 
 %left   HQUA
 %left         HPRIMARYOPERATOR
 
 %left   HQUA
@@ -445,57 +838,43 @@ AT_DATA([[input.y]],
 %left   HDOT
 
 %start  MAIN_MODULE
 %left   HDOT
 
 %start  MAIN_MODULE
-%%
+]],
+[[
 /* GRAMATIKK FOR PROGRAM MODULES */
 /* GRAMATIKK FOR PROGRAM MODULES */
-MAIN_MODULE     :       {        categ=CLOCAL; mout(MBLOCK);
-                                  beginBlock(KBLOKK);separat_comp=FALSE;}
-                       MODULS  { endBlock(NULL,CCNO);   mout(MENDBLOCK);}
+MAIN_MODULE     :       {}
+                       MODULS
                |       error HSTATEMENTSEPARATOR MBEE_DECLSTMS
                ;
 EXT_DECLARATION        :       HEXTERNAL
                        MBEE_TYPE
                        HPROCEDURE
                |       error HSTATEMENTSEPARATOR MBEE_DECLSTMS
                ;
 EXT_DECLARATION        :       HEXTERNAL
                        MBEE_TYPE
                        HPROCEDURE
-                               { MBEENEWBLOCK();
-                                 kind=KPROC;}
+                               {}
                        EXT_LIST
                |
                        HEXTERNAL
                        HIDENTIFIER
                        HPROCEDURE
                        EXT_LIST
                |
                        HEXTERNAL
                        HIDENTIFIER
                        HPROCEDURE
-                               { MBEENEWBLOCK();
-                                 type=TNOTY;
-                                 kind=KPROC;
-                                 if($2==Ckind)categ=CCPROC;else
-                                 yerror (1);
-                                  ysensitive=sensitive;
-                                  sensitive=ON;}
-                       HIDENTIFIER { $<ident>$=$5;
-                                  sensitive=ysensitive;}
+                               {}
+                       HIDENTIFIER {}
                        EXTERNAL_KIND_ITEM
                        EXTERNAL_KIND_ITEM
-                               { categ=CLOCAL;}
                |       HEXTERNAL
                        HCLASS
                |       HEXTERNAL
                        HCLASS
-                               { MBEENEWBLOCK();
-                                 kind=KCLASS;}
+                               {}
                        EXT_LIST
 
                ;
 EXTERNAL_KIND_ITEM:    EXT_IDENT
                        HOBJRELOPERATOR
                        EXT_LIST
 
                ;
 EXTERNAL_KIND_ITEM:    EXT_IDENT
                        HOBJRELOPERATOR
-                               { if($2!=HIS)yerror (2);}
-                       MBEE_TYPE HPROCEDURE
+                               {}
+                       MBEE_TYPE HPROCEDURE
                        HIDENTIFIER
                        HIDENTIFIER
-                               {         regDecl($6, type, KPROC, CCPROC);
-                                          beginBlock(kind);}
-                        HEADING EMPTY_BLOCK
-                               { categ=CLOCAL;
-                                 endBlock($1==NULL?$<ident>0:tag($1),CCCPROC);}
+                               {}
+                       HEADING EMPTY_BLOCK
+                               {}
 /*             |
                        EXT_IDENT
 /*             |
                        EXT_IDENT
-                               { if($1!=NULL)yerror (3);
-                                 regDecl($0, type, kind, categ);}
+                               {}
                        MBEE_REST_EXT_LIST
                        MBEE_REST_EXT_LIST
-                               { endBlock(NULL,CCNO);}
                ;
 MBEE_REST_EXT_LIST:    /* EMPTY
                |       HPAREXPSEPARATOR EXT_KIND_LIST
                ;
 MBEE_REST_EXT_LIST:    /* EMPTY
                |       HPAREXPSEPARATOR EXT_KIND_LIST
@@ -505,8 +884,7 @@ EXT_KIND_LIST       :       EXT_KIND_ITEM
                ;
 EXT_KIND_ITEM  :       HIDENTIFIER
                        EXT_IDENT
                ;
 EXT_KIND_ITEM  :       HIDENTIFIER
                        EXT_IDENT
-                               { if($2!=NULL)yerror (3);
-                                 regDecl($1, type, kind, categ);}*/
+                               {}*/
                ;
 EMPTY_BLOCK    :       /*EMPT*/
                |       HBEGIN HEND
                ;
 EMPTY_BLOCK    :       /*EMPT*/
                |       HBEGIN HEND
@@ -516,687 +894,490 @@ EXT_LIST        :       EXT_ITEM
                ;
 EXT_ITEM       :       HIDENTIFIER
                        EXT_IDENT
                ;
 EXT_ITEM       :       HIDENTIFIER
                        EXT_IDENT
-                               { lesinn_external_spec($1,$2, kind);}
                ;
                ;
-EXT_IDENT      :       /* EMPTY */ { $$=NULL;}
-               |       HVALRELOPERATOR { if($1!=HEQ)yerror (9);
-                                          external=TRUE;}
-                       HTEXTKONST { $$=$3;external=FALSE;}
+EXT_IDENT      :       /* EMPTY */
+               |       HVALRELOPERATOR {}
+                       HTEXTKONST
                ;
 /* GRAMATIKK FOR TYPER */
                ;
 /* GRAMATIKK FOR TYPER */
-NO_TYPE         :       /*EMPT*/        { type=TNOTY;}
-                ;
+NO_TYPE         :       /*EMPT*/
+               ;
 MBEE_TYPE       :       NO_TYPE
 MBEE_TYPE       :       NO_TYPE
-                |       TYPE
-                ;
+               |       TYPE
+               ;
 TYPE            :       HREF HBEGPAR
 TYPE            :       HREF HBEGPAR
-                        HIDENTIFIER
-                                { prefquantident=$3;
-                                          type=TREF;}
-                        HENDPAR
-                |       HTEXT           { type=TTEXT;}
-                |       HBOOLEAN        { type=TBOOL;}
-                |       HCHARACTER      { type=TCHAR;}
-                |       HSHORT HINTEGER { type=TSHORT;}
-                |       HINTEGER        { type=TINTG;}
-                |       HREAL           { type=TREAL;}
-                |       HLONG HREAL     { type=TLONG;}
-                ;
+                       HIDENTIFIER
+                               {}
+                       HENDPAR
+               |       HTEXT
+               |       HBOOLEAN
+               |       HCHARACTER
+               |       HSHORT HINTEGER
+               |       HINTEGER
+               |       HREAL
+               |       HLONG HREAL
+               ;
 
 /* GRAMATIKK FOR DEL AV SETNINGER */
 MBEE_ELSE_PART  :       /*EMPT*/
 /*             |       HELSE
                        HIF
 
 /* GRAMATIKK FOR DEL AV SETNINGER */
 MBEE_ELSE_PART  :       /*EMPT*/
 /*             |       HELSE
                        HIF
-                        EXPRESSION
-                        HTHEN   {                mout(MELSE);
-                                                 mout(MIF);
-                                  OBSBLOCK();}
-                        BLOCK   { MBEEENDBLOCK();}
-                        MBEE_ELSE_PART          { mout(MENDIF);}*/
-                |       HELSE   { OBSBLOCK();     mout(MELSE);}
-                        BLOCK   { MBEEENDBLOCK();}
-                ;
-FOR_LIST        :       FOR_LIST_ELEMENT        { mout(MENDSEP);
-                                                  mout(MLISTSEP);}
-                |       FOR_LIST_ELEMENT
-                        HPAREXPSEPARATOR
-                        FOR_LIST                { mout(MLISTSEP);}
-                ;
+                       EXPRESSION
+                       HTHEN   {}
+                       BLOCK   {}
+                       MBEE_ELSE_PART          {}*/
+               |       HELSE   {}
+                       BLOCK
+               ;
+FOR_LIST        :       FOR_LIST_ELEMENT
+               |       FOR_LIST_ELEMENT
+                       HPAREXPSEPARATOR
+                       FOR_LIST
+               ;
 FOR_LIST_ELEMENT:       EXPRESSION
 FOR_LIST_ELEMENT:       EXPRESSION
-                        MBEE_F_L_EL_R_PT
-                ;
+                       MBEE_F_L_EL_R_PT
+               ;
 MBEE_F_L_EL_R_PT:       /*EMPT*/
 MBEE_F_L_EL_R_PT:       /*EMPT*/
-                |       HWHILE
-                        EXPRESSION              { mout(MFORWHILE);}
-                |       HSTEP
-                        EXPRESSION
-                        HUNTIL
-                        EXPRESSION              { mout(MUNTIL);
-                                                  mout(MSTEP);}
-                ;
+               |       HWHILE
+                       EXPRESSION
+               |       HSTEP
+                       EXPRESSION
+                       HUNTIL
+                       EXPRESSION
+               ;
 GOTO            :       HGO
 GOTO            :       HGO
-                        HTO
-                |       HGOTO
-                ;
+                       HTO
+               |       HGOTO
+               ;
 CONN_STATE_R_PT :       WHEN_CLAUSE_LIST
 CONN_STATE_R_PT :       WHEN_CLAUSE_LIST
-                |       HDO   {   beginBlock(KCON);   mout(MDO);
-                              OBSBLOCK(); }
-                        BLOCK {   endBlock(NULL,CCNO);
-                                  MBEEENDBLOCK();  mout(MENDDO);}
-                ;
+               |       HDO   {}
+                       BLOCK
+               ;
 WHEN_CLAUSE_LIST:       HWHEN
 WHEN_CLAUSE_LIST:       HWHEN
-                        HIDENTIFIER
-                        HDO    {   beginBlock(KCON);  mout(MIDENTIFIER);
-                                   OBSBLOCK();     moutId($2);
-                                                  mout(MWHEN);}
-                        BLOCK  {   endBlock(NULL,CCNO);
-                              MBEEENDBLOCK(); mout(MENDWHEN);}
-                |       WHEN_CLAUSE_LIST
-                        HWHEN
-                        HIDENTIFIER
-                        HDO    { beginBlock(KCON);        mout(MIDENTIFIER);
-                                 OBSBLOCK();       moutId($3);
-                                                  mout(MWHEN);}
-                        BLOCK  { endBlock(NULL,CCNO);
-                              MBEEENDBLOCK();    mout(MENDWHEN);}
-                ;
+                       HIDENTIFIER
+                       HDO    {}
+                       BLOCK
+               |       WHEN_CLAUSE_LIST
+                       HWHEN
+                       HIDENTIFIER
+                       HDO    {}
+                       BLOCK
+               ;
 MBEE_OTWI_CLAUS :       /*EMPT*/
 MBEE_OTWI_CLAUS :       /*EMPT*/
-                |       HOTHERWISE {OBSBLOCK();    mout(MOTHERWISE);}
-
-                        BLOCK      {MBEEENDBLOCK();mout(MENDOTHERWISE);}
-                ;
-ACTIVATOR      :       HACTIVATE               { mout(MBOOLEANKONST);
-                                                 moutIval(FALSE);}
-               |       HREACTIVATE             { mout(MBOOLEANKONST);
-                                                 moutIval(TRUE);}
-               ;
-SCHEDULE       :       /*EMPT*/                { mout(MCHARACTERKONST);
-                                                 moutIval(DIRECT);
-                                                 mout(MINTEGERKONST);
-                                                 moutIval(0);
-                                                 mout(MNONE);
-                                                 mout(MBOOLEANKONST);
-                                                 moutIval(FALSE);}
-               |       ATDELAY EXPRESSION      { mout(MNONE);}
+               |       HOTHERWISE {}
+
+                       BLOCK
+               ;
+ACTIVATOR      :       HACTIVATE
+               |       HREACTIVATE
+               ;
+SCHEDULE       :       /*EMPT*/
+               |       ATDELAY EXPRESSION      {}
                        PRIOR
                        PRIOR
-               |       BEFOREAFTER             { mout(MINTEGERKONST);
-                                                 moutIval(0);}
-                       EXPRESSION              { mout(MBOOLEANKONST);
-                                                 moutIval(FALSE);}
-               ;
-ATDELAY                :       HAT                     { mout(MCHARACTERKONST);
-                                                 moutIval(AT);}
-               |       HDELAY                  { mout(MCHARACTERKONST);
-                                                 moutIval(DELAYS);}
-               ;
-BEFOREAFTER    :       HBEFORE                 { mout(MCHARACTERKONST);
-                                                 moutIval(BEFORE);}
-               |       HAFTER                  { mout(MCHARACTERKONST);
-                                                 moutIval(AFTER);}
-               ;
-PRIOR          :       /*EMPT*/                { mout(MBOOLEANKONST);
-                                                 moutIval(FALSE);}
-               |       HPRIOR                  { mout(MBOOLEANKONST);
-                                                 moutIval(TRUE);}
+               |       BEFOREAFTER             {}
+                       EXPRESSION
+               ;
+ATDELAY                :       HAT
+               |       HDELAY
+               ;
+BEFOREAFTER    :       HBEFORE
+               |       HAFTER
+               ;
+PRIOR          :       /*EMPT*/
+               |       HPRIOR
                ;
 /* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */
 MODULSTATEMENT  :       HWHILE
                ;
 /* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */
 MODULSTATEMENT  :       HWHILE
-                        EXPRESSION
-                        HDO     { STOPOBSBLOCK(); mout(MWHILE);
-                                  OBSBLOCK();}
-                        BLOCK   { MBEEENDBLOCK(); mout(MENDWHILE);
-                                                         $$=STATEMENT;}
+                       EXPRESSION
+                       HDO     {}
+                       BLOCK
                |       HIF
                |       HIF
-                        EXPRESSION
-                        HTHEN   { STOPOBSBLOCK(); mout(MIF);
-                                  OBSBLOCK();}
-                        BLOCK   { MBEEENDBLOCK();}
-                        MBEE_ELSE_PART          { mout(MENDIF);
-                                                         $$=STATEMENT;}
+                       EXPRESSION
+                       HTHEN   {}
+                       BLOCK   {}
+                       MBEE_ELSE_PART
                |       HFOR
                |       HFOR
-                        HIDENTIFIER
-                        HASSIGN { STOPOBSBLOCK(); mout(MIDENTIFIER);
-                                                  moutId($2);}
-                        FOR_LIST
-                        HDO     { beginBlock(KFOR);
-                        if($3==HASSIGNVALUE)      mout(MFOR);
-                                        else      mout(MFORR);
-                                  OBSBLOCK();     mout(MFORDO);}
-                        BLOCK   { MBEEENDBLOCK();
-                                  endBlock(NULL,CCNO); mout(MENDFOR);
-                                                         $$=STATEMENT;}
+                       HIDENTIFIER
+                       HASSIGN {}
+                       FOR_LIST
+                       HDO     {}
+                       BLOCK
                |       GOTO
                |       GOTO
-                        EXPRESSION              { mout(MGOTO);
-                                  STOPOBSBLOCK();        $$=STATEMENT;}
+                       EXPRESSION
                |       HINSPECT
                |       HINSPECT
-                        EXPRESSION              { mout(MINSPECT);
-                                  STOPOBSBLOCK();
-                                  beginBlock(KINSP);}
-                        CONN_STATE_R_PT
-                                { endBlock(NULL,CCNO);}
-                        MBEE_OTWI_CLAUS         { mout(MENDINSPECT);
-                                                         $$=STATEMENT;}
-               |       HINNER  { STOPOBSBLOCK(); mout(MINNER);
-                                  regInner();            $$=STATEMENT;}
-                |       HIDENTIFIER
-                        HLABELSEPARATOR
-                                { STOPOBSBLOCK();
-                                  regDecl($1, TLABEL, KSIMPLE, categ);    mout(MLABEL);
-                                                  moutId($1);
-                                                  mout(MENDLABEL);}
-                        DECLSTATEMENT   { if($4<=DECLARATION)
-                                            { yerror (27);
-                                              $$=DECLARATION;}
-                                          else $$=$4;}
-                |       EXPRESSION_SIMP
-                        HBEGIN
-                                { $<ident>$=$1; }
+                       EXPRESSION              {}
+                       CONN_STATE_R_PT
+                               {}
+                       MBEE_OTWI_CLAUS
+               |       HINNER
+               |       HIDENTIFIER
+                       HLABELSEPARATOR
+                               {}
+                       DECLSTATEMENT
+               |       EXPRESSION_SIMP
+                       HBEGIN
+                               {}
                        IMPORT_SPEC_MODULE
                        IMPORT_SPEC_MODULE
-                               { mout(MPRBLOCK);
-                                 prefquantident=$1;
-                                  beginBlock(KPRBLK);}
-                        MBEE_DECLSTMS
-                        HEND    { endBlock(NULL,CCNO); mout(MENDPRBLOCK);
-                                                          $$=STATEMENT;}
+                               {}
+                       MBEE_DECLSTMS
+                       HEND
                |       EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR
                |       EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR
-                        MBEE_DECLSTMS HEND              { $$=STATEMENT;
-                                endBlock(NULL,CCNO); mout(MENDPRBLOCK);}
+                       MBEE_DECLSTMS HEND
                |       EXPRESSION_SIMP HBEGIN error HEND
                |       EXPRESSION_SIMP HBEGIN error HEND
-                                                       { $$=STATEMENT;
-                                endBlock(NULL,CCNO); mout(MENDPRBLOCK);}
-
-                |       EXPRESSION_SIMP
-                                { STOPOBSBLOCK();         $$=STATEMENT;
-                                                  mout(MENDASSIGN);}
+               |       EXPRESSION_SIMP
                |       ACTIVATOR EXPRESSION SCHEDULE
                |       ACTIVATOR EXPRESSION SCHEDULE
-                                               { $$=STATEMENT;
-                                                 mout(MENDSEP);
-                                                 mout(MARGUMENTSEP);
-                                                 mout(MARGUMENTSEP);
-                                                 mout(MARGUMENTSEP);
-                                                 mout(MARGUMENTSEP);
-                                                 mout(MARGUMENTSEP);
-                                                 mout(MARGUMENTSEP);
-                                                 mout(MARGUMENT);
-                                                 moutId(activateid);
-                                                 mout(MENDASSIGN);}
-                |       HBEGIN
-                                { STOPOBSBLOCK();
-                                  OBSBLOCK();}
-                        MBEE_DECLSTMS
-                        HEND    { MBEEENDBLOCK();         $$=STATEMENT;}
+               |       HBEGIN
+                               {}
+                       MBEE_DECLSTMS
+                       HEND
                |       MBEE_TYPE HPROCEDURE
                |       MBEE_TYPE HPROCEDURE
-                        HIDENTIFIER
-                                { MBEENEWBLOCK(); mout(MPROCEDURE);
-                                          regDecl($3, type, KPROC, categ);
-                                          beginBlock(KPROC);}
-                        HEADING BLOCK   { endBlock(NULL,CCNO); $$=DECLARATION;
-                                                  mout(MENDPROCEDURE);}
+                       HIDENTIFIER
+                               {}
+                       HEADING BLOCK
                |       HIDENTIFIER
                        HCLASS
                |       HIDENTIFIER
                        HCLASS
-                        NO_TYPE
-                               { $<ident>$=$1; }
+                       NO_TYPE
+                               {}
                        IMPORT_SPEC_MODULE
                        IMPORT_SPEC_MODULE
-                        HIDENTIFIER
-                               { prefquantident=$1;
-                                 mout(MCLASS);
-                                          regDecl($6, TNOTY, KCLASS, categ);
-                                          beginBlock(KCLASS);}
-                        HEADING
-                        BLOCK           { endBlock(NULL,CCNO); $$=DECLARATION;
-                                                  mout(MENDCLASS);}
-                |       HCLASS
-                        NO_TYPE
-                        HIDENTIFIER
-                                { prefquantident=0;
-                                  MBEENEWBLOCK(); mout(MCLASS);
-                                          regDecl($3, TNOTY, KCLASS, categ);
-                                          beginBlock(KCLASS);}
-                        HEADING
-                        BLOCK           { endBlock(NULL,CCNO); $$=DECLARATION;
-                                                  mout(MENDCLASS);}
-                |       EXT_DECLARATION                        { $$=EXTDECLARATION;}
-               |       /*EMPT*/{ STOPOBSBLOCK();         $$=EMPTYSTATEMENT;}
-                ;
-IMPORT_SPEC_MODULE:            { MBEENEWBLOCK();
-                                  kind=KCLASS;
-                                 if($<ident>0==simsetident &&
-                                    findDecl(simsetident,cblock,FALSE)==NULL)
-                                   lesinn_external_spec(simsetident,
-                                       SIMSETATRFILE, kind);
-                                 if($<ident>0==simulationident && findDecl(
-                                   simulationident,cblock,FALSE)==NULL)
-                                   lesinn_external_spec(simulationident,
-                                       SIMULATIONATRFILE, kind);
-                                 if(($<ident>0==fileident && findDecl(
-                                     fileident,cblock,FALSE)==NULL) ||
-                                    ($<ident>0==outfileident && findDecl(
-                                     outfileident,cblock,FALSE)==NULL) ||
-                                    ($<ident>0==infileident && findDecl(
-                                     infileident,cblock,FALSE)==NULL) ||
-                                    ($<ident>0==directfileident && findDecl(
-                                     directfileident,cblock,FALSE)==NULL) ||
-                                    ($<ident>0==printfileident && findDecl(
-                                     printfileident,cblock,FALSE)==NULL) ||
-                                    ($<ident>0==bytefileident && findDecl(
-                                     bytefileident,cblock,FALSE)==NULL) ||
-                                    ($<ident>0==inbytefileident && findDecl(
-                                     inbytefileident,cblock,FALSE)==NULL) ||
-                                    ($<ident>0==outbytefileident && findDecl(
-                                     outbytefileident,cblock,FALSE)==NULL) ||
-                                    ($<ident>0==directbytefileident && findDecl(
-                                     directbytefileident,cblock,FALSE)==NULL))
-                                   lesinn_external_spec(fileident,
-                                       FILEATRFILE, kind);}
+                       HIDENTIFIER
+                               {}
+                       HEADING
+                       BLOCK
+               |       HCLASS
+                       NO_TYPE
+                       HIDENTIFIER
+                               {}
+                       HEADING
+                       BLOCK
+               |       EXT_DECLARATION
+               |       /*EMPT*/
+               ;
+IMPORT_SPEC_MODULE:
                ;
 DECLSTATEMENT  :       MODULSTATEMENT
                |       TYPE
                ;
 DECLSTATEMENT  :       MODULSTATEMENT
                |       TYPE
-                        HIDENTIFIER
+                       HIDENTIFIER
                        MBEE_CONSTANT
                        MBEE_CONSTANT
-                        HPAREXPSEPARATOR
-                                { MBEENEWBLOCK();
-                                          kind=KSIMPLE;
-                                          regDecl($2, type, KSIMPLE, categ);
-                                         categ=CLOCAL;}
-                        IDENTIFIER_LISTC                { $$=DECLARATION;}
-                |       TYPE
-                        HIDENTIFIER
+                       HPAREXPSEPARATOR
+                               {}
+                       IDENTIFIER_LISTC
+               |       TYPE
+                       HIDENTIFIER
                        MBEE_CONSTANT
                        MBEE_CONSTANT
-                                { MBEENEWBLOCK();
-                                          regDecl($2, type, KSIMPLE, categ);
-                                         categ=CLOCAL;   $$=DECLARATION;}
-                |       MBEE_TYPE
-                        HARRAY  { MBEENEWBLOCK();
-                                          kind=KARRAY;}
-                        ARR_SEGMENT_LIST                { $$=DECLARATION;}
-                |       HSWITCH
-                        HIDENTIFIER
-                        HASSIGN { MBEENEWBLOCK(); mout(MIDENTIFIER);
-                                                  moutId($2);
-                                          regDecl($2, TLABEL, KARRAY, categ);}
-                        SWITCH_LIST                     { $$=DECLARATION;
-                                                   mout(MSWITCH);
-                                                   mout(MENDSWITCH);}
-                ;
-BLOCK           :       DECLSTATEMENT   { if($1<=DECLARATION)yerror (29);}
-                |       HBEGIN MBEE_DECLSTMS HEND
+               |       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 error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND
                |       HBEGIN error HEND
                ;
-MBEE_DECLSTMS   :       MBEE_DECLSTMSU  { if($1<=DECLARATION)yerror (28);
-                                         $$=$1;}
-                ;
-MBEE_DECLSTMSU  :       DECLSTATEMENT   { $$=$1;}
-                |       MBEE_DECLSTMSU
-                        HSTATEMENTSEPARATOR
-                        DECLSTATEMENT   { if($1>=STATEMENT && $3<=DECLARATION)
-                                            yerror (26);
-                                          $$=$3;}
-                ;
-MODULS         :       MODULSTATEMENT  { if($1==DECLARATION)
-                                         {separat_comp=TRUE;gettimestamp();}
-                                          $$=$1;}
+MBEE_DECLSTMS   :       MBEE_DECLSTMSU
+               ;
+MBEE_DECLSTMSU  :       DECLSTATEMENT
+               |       MBEE_DECLSTMSU
+                       HSTATEMENTSEPARATOR
+                       DECLSTATEMENT
+               ;
+MODULS         :       MODULSTATEMENT
                |       MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
                |       MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
-                                       { if($1>=STATEMENT && $3<=DECLARATION)
-                                            yerror (26);else
-                                         if($1>=STATEMENT
-                                            && $3!=EMPTYSTATEMENT)yerror (25);
-                                          if(separat_comp && $3==STATEMENT)
-                                             yerror (25);
-                                          if($3==DECLARATION && !separat_comp)
-                                         {separat_comp=TRUE;gettimestamp();}
-                                         $$=$3;}
                ;
 /* GRAMATIKK FOR DEL AV DEKLARASJONER */
 ARR_SEGMENT_LIST:       ARR_SEGMENT
                ;
 /* GRAMATIKK FOR DEL AV DEKLARASJONER */
 ARR_SEGMENT_LIST:       ARR_SEGMENT
-                |       ARR_SEGMENT_LIST
-                        HPAREXPSEPARATOR
-                        ARR_SEGMENT
-                ;
+               |       ARR_SEGMENT_LIST
+                       HPAREXPSEPARATOR
+                       ARR_SEGMENT
+               ;
 ARR_SEGMENT    :       ARRAY_SEGMENT
 ARR_SEGMENT    :       ARRAY_SEGMENT
-                        HBEGPAR
-                        BAUND_PAIR_LIST HENDPAR { mout(MARRAY);
-                                                  mout(MENDARRAY);
-                                                  setArrayDim($3);}
-                ;
-ARRAY_SEGMENT   :       ARRAY_SEGMENT_EL        { mout(MENDSEP);
-                                                  mout(MARRAYSEP);}
-
-                |       ARRAY_SEGMENT_EL
-                        HPAREXPSEPARATOR
-                        ARRAY_SEGMENT           { mout(MARRAYSEP);}
-                ;
-ARRAY_SEGMENT_EL:       HIDENTIFIER             { mout(MIDENTIFIER);
-                                                  moutId($1);
-                                                  regDecl($1, type, kind, categ);
-                                  if(lastArray==NULL)
-                                     lastArray=cblock->lastparloc;}
-                ;
-BAUND_PAIR_LIST :       BAUND_PAIR              { mout(MENDSEP);
-                                                  mout(MBOUNDSEP);
-                                                  $$=1;}
-                |       BAUND_PAIR
-                        HPAREXPSEPARATOR
-                        BAUND_PAIR_LIST         { mout(MBOUNDSEP);
-                                                  $$=$3+1;}
-                ;
+                       HBEGPAR
+                       BAUND_PAIR_LIST HENDPAR
+               ;
+ARRAY_SEGMENT   :       ARRAY_SEGMENT_EL        {}
+
+               |       ARRAY_SEGMENT_EL
+                       HPAREXPSEPARATOR
+                       ARRAY_SEGMENT
+               ;
+ARRAY_SEGMENT_EL:       HIDENTIFIER
+               ;
+BAUND_PAIR_LIST :       BAUND_PAIR
+               |       BAUND_PAIR
+                       HPAREXPSEPARATOR
+                       BAUND_PAIR_LIST
+               ;
 BAUND_PAIR      :       EXPRESSION
 BAUND_PAIR      :       EXPRESSION
-                        HLABELSEPARATOR
-                        EXPRESSION              { mout(MBOUNDPARSEP);}
-                ;
-SWITCH_LIST     :       EXPRESSION              { mout(MENDSEP);
-                                                  mout(MSWITCHSEP);}
-                |       EXPRESSION
-                        HPAREXPSEPARATOR
-                        SWITCH_LIST             { mout(MSWITCHSEP);}
-                ;
-HEADING         :       MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR { kind=KNOKD;}
-                        MBEE_MODE_PART  { categ=CSPEC;}
-                        MBEE_SPEC_PART  { kind=KNOKD;}
-                        MBEE_PROT_PART  { categ=CVIRT;}
-                        MBEE_VIRT_PART
-                                        { categ=CLOCAL;}
-                ;
+                       HLABELSEPARATOR
+                       EXPRESSION
+               ;
+SWITCH_LIST     :       EXPRESSION
+               |       EXPRESSION
+                       HPAREXPSEPARATOR
+                       SWITCH_LIST
+               ;
+HEADING         :       MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {}
+                       MBEE_MODE_PART  {}
+                       MBEE_SPEC_PART  {}
+                       MBEE_PROT_PART  {}
+                       MBEE_VIRT_PART
+               ;
 MBEE_FMAL_PAR_P :       /*EMPT*/
 MBEE_FMAL_PAR_P :       /*EMPT*/
-                |       FMAL_PAR_PART
-                ;
+               |       FMAL_PAR_PART
+               ;
 FMAL_PAR_PART   :       HBEGPAR NO_TYPE
 FMAL_PAR_PART   :       HBEGPAR NO_TYPE
-                        MBEE_LISTV HENDPAR
-                ;
+                       MBEE_LISTV HENDPAR
+               ;
 MBEE_LISTV      :       /*EMPT*/
 MBEE_LISTV      :       /*EMPT*/
-                |       LISTV
-                ;
-LISTV           :       HIDENTIFIER     { regDecl($1, type, KNOKD, CDEFLT);}
-                |      FPP_CATEG HDOTDOTDOT      { regDecl(varargsid, TVARARGS, KNOKD, categ);}
-                |       HIDENTIFIER     { regDecl($1, type, KNOKD, CDEFLT);}
-                        HPAREXPSEPARATOR LISTV {}
-                |       FPP_SPEC
-                |       FPP_SPEC
-                        HPAREXPSEPARATOR LISTV
-                ;
+               |       LISTV
+               ;
+LISTV           :       HIDENTIFIER
+               |       FPP_CATEG HDOTDOTDOT
+               |       HIDENTIFIER     {}
+                       HPAREXPSEPARATOR LISTV
+               |       FPP_SPEC
+               |       FPP_SPEC
+                       HPAREXPSEPARATOR LISTV
+               ;
 FPP_HEADING     :       HBEGPAR NO_TYPE
 FPP_HEADING     :       HBEGPAR NO_TYPE
-                        FPP_MBEE_LISTV HENDPAR
-                ;
+                       FPP_MBEE_LISTV HENDPAR
+               ;
 FPP_MBEE_LISTV  :       /*EMPT*/
 FPP_MBEE_LISTV  :       /*EMPT*/
-                |       FPP_LISTV
-                ;
-FPP_LISTV       :      FPP_CATEG HDOTDOTDOT      { regDecl(varargsid, TVARARGS, KNOKD, categ);}
-                |       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_SPEC        :       FPP_CATEG SPECIFIER HIDENTIFIER
-                                       { regDecl($3, type, kind, categ);}
                |       FPP_CATEG FPP_PROC_DECL_IN_SPEC
                ;
 FPP_CATEG       :       HNAME HLABELSEPARATOR
                |       FPP_CATEG FPP_PROC_DECL_IN_SPEC
                ;
 FPP_CATEG       :       HNAME HLABELSEPARATOR
-                                       { categ=CNAME;}
-                |       HVALUE HLABELSEPARATOR
-                                       { categ=CVALUE;}
-                |       HVAR HLABELSEPARATOR
-                                       { categ=CVAR;}
-                |       /*EMPT*/       { categ=CDEFLT;}
-                ;
+               |       HVALUE HLABELSEPARATOR
+               |       HVAR HLABELSEPARATOR
+               |       /*EMPT*/
+               ;
 FPP_PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE
 FPP_PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE
-                        HIDENTIFIER
-                                       { $<ival>$=categ;
-                                          regDecl($3, type, KPROC, categ);
-                                          beginBlock(KPROC);}
-                        FPP_HEADING
-                                       { categ=$<ival>4; /* M} settes tilbake*/}
-                               { endBlock(NULL,CCNO);}
-               ;
-IDENTIFIER_LISTV:       HIDENTIFIER     { regDecl($1, type, kind, categ);}
-                |      HDOTDOTDOT {      regDecl(varargsid, TVARARGS, kind, categ);}
-                |       HIDENTIFIER     { regDecl($1, type, kind, categ);}
-                        HPAREXPSEPARATOR IDENTIFIER_LISTV {}
-                ;
+                       HIDENTIFIER
+                                       {}
+                       FPP_HEADING {} { /* Yes, two "final" actions. */ }
+               ;
+IDENTIFIER_LISTV:       HIDENTIFIER
+               |       HDOTDOTDOT
+               |       HIDENTIFIER     {}
+                       HPAREXPSEPARATOR IDENTIFIER_LISTV
+               ;
 MBEE_MODE_PART  :       /*EMPT*/
 MBEE_MODE_PART  :       /*EMPT*/
-                |       MODE_PART
-                ;
+               |       MODE_PART
+               ;
 MODE_PART       :       NAME_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
-                ;
-NAME_PART       :       HNAME           { categ=CNAME;}
-                        IDENTIFIER_LISTV
-                        HSTATEMENTSEPARATOR
-                ;
-VAR_PART        :       HVAR            { categ=CVAR;}
-                        IDENTIFIER_LISTV
-                        HSTATEMENTSEPARATOR
-                ;
-VALUE_PART      :       HVALUE          { categ=CVALUE;}
-                        IDENTIFIER_LISTV HSTATEMENTSEPARATOR
-                ;
+               |       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
+               ;
+VAR_PART        :       HVAR            {}
+                       IDENTIFIER_LISTV
+                       HSTATEMENTSEPARATOR
+               ;
+VALUE_PART      :       HVALUE          {}
+                       IDENTIFIER_LISTV HSTATEMENTSEPARATOR
+               ;
 MBEE_SPEC_PART  :       /*EMPT*/
 MBEE_SPEC_PART  :       /*EMPT*/
-                |       SPEC_PART
-                ;
+               |       SPEC_PART
+               ;
 SPEC_PART       :       ONE_SPEC
 SPEC_PART       :       ONE_SPEC
-                |       SPEC_PART ONE_SPEC
-                ;
+               |       SPEC_PART ONE_SPEC
+               ;
 ONE_SPEC       :       SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR
                |       NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR
 ONE_SPEC       :       SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR
                |       NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR
-                         { if($4!=HIS) yerror (8);}
+                         {}
                        PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
                        PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
-                |       FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
-                |       MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR
-                                       { yerror (45);}
-                |       MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR
-                        IDENTIFIER_LIST HSTATEMENTSEPARATOR
-                                       { yerror (45);}
-               ;
-SPECIFIER       :       TYPE            { kind=KSIMPLE;}
-                |       MBEE_TYPE
-                        HARRAY          { kind=KARRAY;}
-                |       HLABEL          { type=TLABEL;
-                                          kind=KSIMPLE;}
-                |       HSWITCH         { type=TLABEL;
-                                          kind=KARRAY;}
-                ;
+               |       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
 PROC_DECL_IN_SPEC:     MBEE_TYPE HPROCEDURE
-                        HIDENTIFIER
-                                       { $<ival>$=categ;
-                                          regDecl($3, type, KPROC, categ);
-                                          beginBlock(KPROC);}
-                        HEADING
-                                       { categ=$<ival>4; /* M} settes tilbake*/}
+                       HIDENTIFIER
+                                       {}
+                       HEADING
+                                       {}
                        MBEE_BEGIN_END
                        MBEE_BEGIN_END
-                               { endBlock(NULL,CCNO);}
                ;
 MBEE_BEGIN_END :       /* EMPTY */
                |       HBEGIN HEND
                ;
 MBEE_PROT_PART  :       /*EMPT*/
                ;
 MBEE_BEGIN_END :       /* EMPTY */
                |       HBEGIN HEND
                ;
 MBEE_PROT_PART  :       /*EMPT*/
-                |       PROTECTION_PART
-                ;
+               |       PROTECTION_PART
+               ;
 PROTECTION_PART :       PROT_SPECIFIER IDENTIFIER_LIST
 PROTECTION_PART :       PROT_SPECIFIER IDENTIFIER_LIST
-                        HSTATEMENTSEPARATOR
-                |       PROTECTION_PART  PROT_SPECIFIER
-                        IDENTIFIER_LIST HSTATEMENTSEPARATOR
-                ;
-PROT_SPECIFIER  :       HHIDDEN         { categ=CHIDEN;}
-                |       HPROTECTED      { categ=CPROT;}
-                |       HHIDDEN
-                        HPROTECTED      { categ=CHIPRO;}
-                |       HPROTECTED
-                        HHIDDEN         { categ=CHIPRO;}
-                ;
+                       HSTATEMENTSEPARATOR
+               |       PROTECTION_PART  PROT_SPECIFIER
+                       IDENTIFIER_LIST HSTATEMENTSEPARATOR
+               ;
+PROT_SPECIFIER  :       HHIDDEN
+               |       HPROTECTED
+               |       HHIDDEN
+                       HPROTECTED
+               |       HPROTECTED
+                       HHIDDEN
+               ;
 MBEE_VIRT_PART  :       /*EMPT*/
 MBEE_VIRT_PART  :       /*EMPT*/
-                |       VIRTUAL_PART
-                ;
+               |       VIRTUAL_PART
+               ;
 VIRTUAL_PART    :       HVIRTUAL
 VIRTUAL_PART    :       HVIRTUAL
-                        HLABELSEPARATOR
-                        MBEE_SPEC_PART
-                ;
-IDENTIFIER_LIST :       HIDENTIFIER     { regDecl($1, type, kind, categ);}
-                |       IDENTIFIER_LIST HPAREXPSEPARATOR
-                        HIDENTIFIER     { regDecl($3, type, kind, categ);}
-                ;
+                       HLABELSEPARATOR
+                       MBEE_SPEC_PART
+               ;
+IDENTIFIER_LIST :       HIDENTIFIER
+               |       IDENTIFIER_LIST HPAREXPSEPARATOR
+                       HIDENTIFIER
+               ;
 IDENTIFIER_LISTC:       HIDENTIFIER
 IDENTIFIER_LISTC:       HIDENTIFIER
-                       MBEE_CONSTANT   { regDecl($1, type, kind, categ);
-                                         categ=CLOCAL;}
-                |       IDENTIFIER_LISTC HPAREXPSEPARATOR
-                        HIDENTIFIER
-                       MBEE_CONSTANT   { regDecl($3, type, kind, categ);
-                                         categ=CLOCAL;}
-                ;
+                       MBEE_CONSTANT
+               |       IDENTIFIER_LISTC HPAREXPSEPARATOR
+                       HIDENTIFIER
+                       MBEE_CONSTANT
+               ;
 MBEE_CONSTANT  :       /* EMPTY */
                |       HVALRELOPERATOR
 MBEE_CONSTANT  :       /* EMPTY */
                |       HVALRELOPERATOR
-                               { MBEENEWBLOCK();
-                           if($1!=HEQ) yerror (8);
-                                         if(type==TREF)yerror (7);
-                                         categ=CCONSTU;
-                                                 mout(MIDENTIFIER);
-                                                 moutId($<token>0);}
-                       EXPRESSION              { mout(MASSIGN);
-                                                 mout(MCONST);}
+                               {}
+                       EXPRESSION
                ;
 
 /* GRAMATIKK FOR UTTRYKK */
                ;
 
 /* GRAMATIKK FOR UTTRYKK */
-EXPRESSION      :       EXPRESSION_SIMP {}
-                |       HIF
-                        EXPRESSION
-                        HTHEN
-                        EXPRESSION
-                        HELSE
-                        EXPRESSION              { mout(MELSEE);
-                                                  mout(MIFE);}
-                ;
+EXPRESSION      :       EXPRESSION_SIMP
+               |       HIF
+                       EXPRESSION
+                       HTHEN
+                       EXPRESSION
+                       HELSE
+                       EXPRESSION
+               ;
 EXPRESSION_SIMP :      EXPRESSION_SIMP
                        HASSIGN
 EXPRESSION_SIMP :      EXPRESSION_SIMP
                        HASSIGN
-                       EXPRESSION { if($2==HASSIGNREF)mout(MASSIGNR);
-                                          else    mout(MASSIGN);$$=NULL;}
+                       EXPRESSION
                |
 
                        EXPRESSION_SIMP
                |
 
                        EXPRESSION_SIMP
-                        HCONC
-                        EXPRESSION_SIMP         { mout(MCONC);$$=NULL;}
-                |       EXPRESSION_SIMP HOR
-                        HELSE
-                        EXPRESSION_SIMP
-                        %prec HORELSE           { mout(MORELSEE);$$=NULL;}
-                |       EXPRESSION_SIMP HAND
-                        HTHEN
-                        EXPRESSION_SIMP
-                        %prec HANDTHEN          { mout(MANDTHENE);$$=NULL;}
-                |       EXPRESSION_SIMP
-                        HEQV EXPRESSION_SIMP    { mout(MEQV);$$=NULL;}
-                |       EXPRESSION_SIMP
-                        HIMP EXPRESSION_SIMP    { mout(MIMP);$$=NULL;}
-                |       EXPRESSION_SIMP
-                        HOR EXPRESSION_SIMP     { mout(MOR);$$=NULL;}
-                |       EXPRESSION_SIMP
-                        HAND EXPRESSION_SIMP    { mout(MAND);$$=NULL;}
-                |       HNOT EXPRESSION_SIMP    { mout(MNOT);$$=NULL;}
-                |       EXPRESSION_SIMP
-                        HVALRELOPERATOR
-                        EXPRESSION_SIMP
-                                { switch($2)
-                                    {   case HEQ: mout(MEQ);break;
-                                        case HNE: mout(MNE);break;
-                                        case HLT: mout(MLT);break;
-                                        case HLE: mout(MLE);break;
-                                        case HGT: mout(MGT);break;
-                                        case HGE: mout(MGE);break;
-                                    }$$=NULL;}
-                |       EXPRESSION_SIMP
-                        HREFRELOPERATOR
-                        EXPRESSION_SIMP
-                                { if($2==HNER)    mout(MNER);
-                                        else      mout(MEQR);$$=NULL;}
-                |       EXPRESSION_SIMP
-                        HOBJRELOPERATOR
-                        EXPRESSION_SIMP
-                                { if($2==HIS)     mout(MIS);
-                                        else      mout(MINS);$$=NULL;}
-                |       HTERMOPERATOR
-                        EXPRESSION_SIMP %prec UNEAR
-                                { if($1==HADD)    mout(MUADD);
-                                        else      mout(MUSUB);$$=NULL;}
-                |       EXPRESSION_SIMP
-                        HTERMOPERATOR
-                        EXPRESSION_SIMP
-                                { if($2==HADD)    mout(MADD);
-                                        else      mout(MSUB);$$=NULL;}
-                |       EXPRESSION_SIMP
-                        HFACTOROPERATOR
-                        EXPRESSION_SIMP
-                                { if($2==HMUL)    mout(MMUL); else
-                                  if($2==HDIV)    mout(MDIV);
-                                        else      mout(MINTDIV);$$=NULL;}
-                |       EXPRESSION_SIMP
-                        HPRIMARYOPERATOR
-                        EXPRESSION_SIMP         { mout(MPRIMARY);$$=NULL;}
-                |       HBEGPAR
-                        EXPRESSION HENDPAR      { mout(MNOOP);$$=NULL;}
-                |       HTEXTKONST              { mout(MTEXTKONST);
-                                                  moutTval($1);$$=NULL;}
-                |       HCHARACTERKONST         { mout(MCHARACTERKONST);
-                                                  moutIval($1);$$=NULL;}
-                |       HREALKONST              { mout(MREALKONST);
-                                                  moutRval($1);$$=NULL;}
-                |       HINTEGERKONST           { mout(MINTEGERKONST);
-                                                  moutIval($1);$$=NULL;}
-                |       HBOOLEANKONST           { mout(MBOOLEANKONST);
-                                                  moutIval($1);$$=NULL;}
-                |       HNONE                   { mout(MNONE);$$=NULL;}
-                |       HIDENTIFIER
-                                { $<ident>$=$1;}
-                        MBEE_ARG_R_PT {}
-                |       HTHIS HIDENTIFIER       { mout(MTHIS);
-                                                  moutId($2);$$=NULL;}
-                |       HNEW
-                        HIDENTIFIER
-                        ARG_R_PT                { mout(MNEWARG);
-                                                  moutId($2);$$=NULL;}
-                |       EXPRESSION_SIMP
-                        HDOT
-                        EXPRESSION_SIMP         { mout(MDOT);$$=NULL;}
-                |       EXPRESSION_SIMP
-                        HQUA HIDENTIFIER        { mout(MQUA);
-                                                  moutId($3);$$=NULL;}
-                ;
-ARG_R_PT        :       /*EMPTY*/               { mout(MENDSEP);}
-                |       HBEGPAR
-                        ARGUMENT_LIST HENDPAR
-                ;
-MBEE_ARG_R_PT   :       /*EMPTY*/               { mout(MIDENTIFIER);
-                                                  moutId($<ident>0);
-                                                 $$=$<ident>0;}
-                |       HBEGPAR
-                        ARGUMENT_LIST HENDPAR   { mout(MARGUMENT);
-                                                  moutId($<ident>0);}
-                ;
-ARGUMENT_LIST   :       EXPRESSION              { mout(MENDSEP);
-                                                  mout(MARGUMENTSEP);}
-                |       EXPRESSION
-                        HPAREXPSEPARATOR
-                        ARGUMENT_LIST           { mout(MARGUMENTSEP);}
-                ;
-%%
-]])
-
-# Pass plenty of options, to exercise plenty of code, even if we
-# don't actually check the output.  But SEGV is watching us, and
-# so might do dmalloc.
-AT_CHECK([[bison --verbose --defines input.y]], 0, [],
-[[input.y: conflicts: 78 shift/reduce, 10 reduce/reduce
-]])
-
-AT_CHECK([[grep '^State.*conflicts:' input.output]], 0,
+                       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
+               ;
+MBEE_ARG_R_PT   :       /*EMPTY*/
+               |       HBEGPAR
+                       ARGUMENT_LIST HENDPAR
+               ;
+ARGUMENT_LIST   :       EXPRESSION
+               |       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]])[
+]],
+
+dnl LAST-STATE
+[AT_COND_CASE([[canonical LR]], [[10425]], [[442]])],
+
+dnl LALR1-DIFF not used for canonical LR(1) because the diff is huge.
+[],
+
+dnl OTHER-CHECKS
+[AT_COND_CASE([[canonical LR]], [[]],
+[AT_CHECK([[grep '^State.*conflicts:' input.output]], [[0]],
 [[State 64 conflicts: 14 shift/reduce
 State 164 conflicts: 1 shift/reduce
 State 201 conflicts: 33 shift/reduce, 4 reduce/reduce
 [[State 64 conflicts: 14 shift/reduce
 State 164 conflicts: 1 shift/reduce
 State 201 conflicts: 33 shift/reduce, 4 reduce/reduce
@@ -1206,48 +1387,26 @@ State 335 conflicts: 9 shift/reduce, 2 reduce/reduce
 State 356 conflicts: 1 shift/reduce
 State 360 conflicts: 9 shift/reduce, 2 reduce/reduce
 State 427 conflicts: 9 shift/reduce, 2 reduce/reduce
 State 356 conflicts: 1 shift/reduce
 State 360 conflicts: 9 shift/reduce, 2 reduce/reduce
 State 427 conflicts: 9 shift/reduce, 2 reduce/reduce
-]])
-
-AT_CLEANUP
+]])])])
 
 
-
-## ----------------- ##
-## GNU pic Grammar.  ##
-## ----------------- ##
-
-AT_SETUP([GNU pic Grammar])
+## -------------------------------- ##
+## GNU pic (Groff 1.18.1) Grammar.  ##
+## -------------------------------- ##
 
 # GNU pic, part of groff.
 
 # Bison once reported shift/reduce conflicts that it shouldn't have.
 
 
 # GNU pic, part of groff.
 
 # Bison once reported shift/reduce conflicts that it shouldn't have.
 
-AT_DATA([[input.y]],
-[[%union {
-       char *str;
-       int n;
-       double x;
-       struct { double x, y; } pair;
-       struct { double x; char *body; } if_data;
-       struct { char *str; const char *filename; int lineno; } lstr;
-       struct { double *v; int nv; int maxv; } dv;
-       struct { double val; int is_multiplicative; } by;
-       place pl;
-       object *obj;
-       corner crn;
-       path *pth;
-       object_spec *spec;
-       saved_state *pstate;
-       graphics_state state;
-       object_type obtype;
-}
-
-%token <str> LABEL
-%token <str> VARIABLE
-%token <x> NUMBER
-%token <lstr> TEXT
-%token <lstr> COMMAND_LINE
-%token <str> DELIMITED
-%token <n> ORDINAL
+AT_TEST_EXISTING_GRAMMAR([[GNU pic (Groff 1.18.1) Grammar]],
+[[%error-verbose
+
+%token LABEL
+%token VARIABLE
+%token NUMBER
+%token TEXT
+%token COMMAND_LINE
+%token DELIMITED
+%token ORDINAL
 %token TH
 %token LEFT_ARROW_HEAD
 %token RIGHT_ARROW_HEAD
 %token TH
 %token LEFT_ARROW_HEAD
 %token RIGHT_ARROW_HEAD
@@ -1405,45 +1564,20 @@ works */
 %left '*' '/' '%'
 %right '!'
 %right '^'
 %left '*' '/' '%'
 %right '!'
 %right '^'
-
-%type <x> expr any_expr text_expr
-%type <by> optional_by
-%type <pair> expr_pair position_not_place
-%type <if_data> simple_if
-%type <obj> nth_primitive
-%type <crn> corner
-%type <pth> path label_path relative_path
-%type <pl> place label element element_list middle_element_list
-%type <spec> object_spec
-%type <pair> position
-%type <obtype> object_type
-%type <n> optional_ordinal_last ordinal
-%type <str> until
-%type <dv> sprintf_args
-%type <lstr> text print_args print_arg
-
-%%
-
+]],
+[[
 top:
        optional_separator
        | element_list
 top:
        optional_separator
        | element_list
-               {
-                 if (olist.head)
-                   print_picture(olist.head);
-               }
        ;
 
        ;
 
-
 element_list:
        optional_separator middle_element_list optional_separator
 element_list:
        optional_separator middle_element_list optional_separator
-               { $$ = $2; }
        ;
 
 middle_element_list:
        element
        ;
 
 middle_element_list:
        element
-               { $$ = $1; }
        | middle_element_list separator element
        | middle_element_list separator element
-               { $$ = $1; }
        ;
 
 optional_separator:
        ;
 
 optional_separator:
@@ -1458,844 +1592,191 @@ separator:
 
 placeless_element:
        VARIABLE '=' any_expr
 
 placeless_element:
        VARIABLE '=' any_expr
-               {
-                 define_variable($1, $3);
-                 a_delete $1;
-               }
        | VARIABLE ':' '=' any_expr
        | VARIABLE ':' '=' any_expr
-               {
-                 place *p = lookup_label($1);
-                 if (!p) {
-                   lex_error("variable `%1' not defined", $1);
-                   YYABORT;
-                 }
-                 p->obj = 0;
-                 p->x = $4;
-                 p->y = 0.0;
-                 a_delete $1;
-               }
        | UP
        | UP
-               { current_direction = UP_DIRECTION; }
        | DOWN
        | DOWN
-               { current_direction = DOWN_DIRECTION; }
        | LEFT
        | LEFT
-               { current_direction = LEFT_DIRECTION; }
        | RIGHT
        | RIGHT
-               { current_direction = RIGHT_DIRECTION; }
        | COMMAND_LINE
        | COMMAND_LINE
-               {
-                 olist.append(make_command_object($1.str, $1.filename,
-                                                  $1.lineno));
-               }
        | COMMAND print_args
        | COMMAND print_args
-               {
-                 olist.append(make_command_object($2.str, $2.filename,
-                                                  $2.lineno));
-               }
        | PRINT print_args
        | PRINT print_args
-               {
-                 fprintf(stderr, "%s\n", $2.str);
-                 a_delete $2.str;
-                 fflush(stderr);
-               }
        | SH
        | SH
-               { delim_flag = 1; }
+               {}
          DELIMITED
          DELIMITED
-               {
-                 delim_flag = 0;
-                 if (safer_flag)
-                   lex_error("unsafe to run command `%1'", $3);
-                 else
-                   system($3);
-                 a_delete $3;
-               }
        | COPY TEXT
        | COPY TEXT
-               {
-                 if (yychar < 0)
-                   do_lookahead();
-                 do_copy($2.str);
-                 // do not delete the filename
-               }
        | COPY TEXT THRU
        | COPY TEXT THRU
-               { delim_flag = 2; }
+               {}
          DELIMITED
          DELIMITED
-               { delim_flag = 0; }
+               {}
          until
          until
-               {
-                 if (yychar < 0)
-                   do_lookahead();
-                 copy_file_thru($2.str, $5, $7);
-                 // do not delete the filename
-                 a_delete $5;
-                 a_delete $7;
-               }
        | COPY THRU
        | COPY THRU
-               { delim_flag = 2; }
+               {}
          DELIMITED
          DELIMITED
-               { delim_flag = 0; }
+               {}
          until
          until
-               {
-                 if (yychar < 0)
-                   do_lookahead();
-                 copy_rest_thru($4, $6);
-                 a_delete $4;
-                 a_delete $6;
-               }
        | FOR VARIABLE '=' expr TO expr optional_by DO
        | FOR VARIABLE '=' expr TO expr optional_by DO
-               { delim_flag = 1; }
+               {}
          DELIMITED
          DELIMITED
-               {
-                 delim_flag = 0;
-                 if (yychar < 0)
-                   do_lookahead();
-                 do_for($2, $4, $6, $7.is_multiplicative, $7.val, $10);
-               }
        | simple_if
        | simple_if
-               {
-                 if (yychar < 0)
-                   do_lookahead();
-                 if ($1.x != 0.0)
-                   push_body($1.body);
-                 a_delete $1.body;
-               }
        | simple_if ELSE
        | simple_if ELSE
-               { delim_flag = 1; }
+               {}
          DELIMITED
          DELIMITED
-               {
-                 delim_flag = 0;
-                 if (yychar < 0)
-                   do_lookahead();
-                 if ($1.x != 0.0)
-                   push_body($1.body);
-                 else
-                   push_body($4);
-                 a_delete $1.body;
-                 a_delete $4;
-               }
        | reset_variables
        | RESET
        | reset_variables
        | RESET
-               { define_variable("scale", 1.0); }
        ;
 
 reset_variables:
        RESET VARIABLE
        ;
 
 reset_variables:
        RESET VARIABLE
-               {
-                 reset($2);
-                 a_delete $2;
-               }
        | reset_variables VARIABLE
        | reset_variables VARIABLE
-               {
-                 reset($2);
-                 a_delete $2;
-               }
        | reset_variables ',' VARIABLE
        | reset_variables ',' VARIABLE
-               {
-                 reset($3);
-                 a_delete $3;
-               }
        ;
 
 print_args:
        print_arg
        ;
 
 print_args:
        print_arg
-               { $$ = $1; }
        | print_args print_arg
        | print_args print_arg
-               {
-                 $$.str = new char[strlen($1.str) + strlen($2.str) + 1];
-                 strcpy($$.str, $1.str);
-                 strcat($$.str, $2.str);
-                 a_delete $1.str;
-                 a_delete $2.str;
-                 if ($1.filename) {
-                   $$.filename = $1.filename;
-                   $$.lineno = $1.lineno;
-                 }
-                 else if ($2.filename) {
-                   $$.filename = $2.filename;
-                   $$.lineno = $2.lineno;
-                 }
-               }
        ;
 
 print_arg:
        expr                                                    %prec ','
        ;
 
 print_arg:
        expr                                                    %prec ','
-               {
-                 $$.str = new char[GDIGITS + 1];
-                 sprintf($$.str, "%g", $1);
-                 $$.filename = 0;
-                 $$.lineno = 0;
-               }
        | text
        | text
-               { $$ = $1; }
        | position                                              %prec ','
        | position                                              %prec ','
-               {
-                 $$.str = new char[GDIGITS + 2 + GDIGITS + 1];
-                 sprintf($$.str, "%g, %g", $1.x, $1.y);
-                 $$.filename = 0;
-                 $$.lineno = 0;
-               }
        ;
 
 simple_if:
        IF any_expr THEN
        ;
 
 simple_if:
        IF any_expr THEN
-               { delim_flag = 1; }
+               {}
        DELIMITED
        DELIMITED
-               {
-                 delim_flag = 0;
-                 $$.x = $2;
-                 $$.body = $5;
-               }
        ;
 
 until:
        /* empty */
        ;
 
 until:
        /* empty */
-               { $$ = 0; }
        | UNTIL TEXT
        | UNTIL TEXT
-               { $$ = $2.str; }
        ;
 
 any_expr:
        expr
        ;
 
 any_expr:
        expr
-               { $$ = $1; }
        | text_expr
        | text_expr
-               { $$ = $1; }
        ;
 
 text_expr:
        text EQUALEQUAL text
        ;
 
 text_expr:
        text EQUALEQUAL text
-               {
-                 $$ = strcmp($1.str, $3.str) == 0;
-                 a_delete $1.str;
-                 a_delete $3.str;
-               }
        | text NOTEQUAL text
        | text NOTEQUAL text
-               {
-                 $$ = strcmp($1.str, $3.str) != 0;
-                 a_delete $1.str;
-                 a_delete $3.str;
-               }
        | text_expr ANDAND text_expr
        | text_expr ANDAND text_expr
-               { $$ = ($1 != 0.0 && $3 != 0.0); }
        | text_expr ANDAND expr
        | text_expr ANDAND expr
-               { $$ = ($1 != 0.0 && $3 != 0.0); }
        | expr ANDAND text_expr
        | expr ANDAND text_expr
-               { $$ = ($1 != 0.0 && $3 != 0.0); }
        | text_expr OROR text_expr
        | text_expr OROR text_expr
-               { $$ = ($1 != 0.0 || $3 != 0.0); }
        | text_expr OROR expr
        | text_expr OROR expr
-               { $$ = ($1 != 0.0 || $3 != 0.0); }
        | expr OROR text_expr
        | expr OROR text_expr
-               { $$ = ($1 != 0.0 || $3 != 0.0); }
        | '!' text_expr
        | '!' text_expr
-               { $$ = ($2 == 0.0); }
        ;
 
        ;
 
-
 optional_by:
        /* empty */
 optional_by:
        /* empty */
-               {
-                 $$.val = 1.0;
-                 $$.is_multiplicative = 0;
-               }
        | BY expr
        | BY expr
-               {
-                 $$.val = $2;
-                 $$.is_multiplicative = 0;
-               }
        | BY '*' expr
        | BY '*' expr
-               {
-                 $$.val = $3;
-                 $$.is_multiplicative = 1;
-               }
        ;
 
 element:
        object_spec
        ;
 
 element:
        object_spec
-               {
-                 $$.obj = $1->make_object(&current_position,
-                                          &current_direction);
-                 if ($$.obj == 0)
-                   YYABORT;
-                 delete $1;
-                 if ($$.obj)
-                   olist.append($$.obj);
-                 else {
-                   $$.x = current_position.x;
-                   $$.y = current_position.y;
-                 }
-               }
        | LABEL ':' optional_separator element
        | LABEL ':' optional_separator element
-               {
-                 $$ = $4;
-                 define_label($1, & $$);
-                 a_delete $1;
-               }
        | LABEL ':' optional_separator position_not_place
        | LABEL ':' optional_separator position_not_place
-               {
-                 $$.obj = 0;
-                 $$.x = $4.x;
-                 $$.y = $4.y;
-                 define_label($1, & $$);
-                 a_delete $1;
-               }
        | LABEL ':' optional_separator place
        | LABEL ':' optional_separator place
-               {
-                 $$ = $4;
-                 define_label($1, & $$);
-                 a_delete $1;
-               }
-       | '{'
-               {
-                 $<state>$.x = current_position.x;
-                 $<state>$.y = current_position.y;
-                 $<state>$.dir = current_direction;
-               }
-         element_list '}'
-               {
-                 current_position.x = $<state>2.x;
-                 current_position.y = $<state>2.y;
-                 current_direction = $<state>2.dir;
-               }
+       | '{' {} element_list '}'
+               {}
          optional_element
          optional_element
-               {
-                 $$ = $3;
-               }
        | placeless_element
        | placeless_element
-               {
-                 $$.obj = 0;
-                 $$.x = current_position.x;
-                 $$.y = current_position.y;
-               }
        ;
 
 optional_element:
        /* empty */
        ;
 
 optional_element:
        /* empty */
-               {}
        | element
        | element
-               {}
        ;
 
 object_spec:
        BOX
        ;
 
 object_spec:
        BOX
-               { $$ = new object_spec(BOX_OBJECT); }
        | CIRCLE
        | CIRCLE
-               { $$ = new object_spec(CIRCLE_OBJECT); }
        | ELLIPSE
        | ELLIPSE
-               { $$ = new object_spec(ELLIPSE_OBJECT); }
        | ARC
        | ARC
-               {
-                 $$ = new object_spec(ARC_OBJECT);
-                 $$->dir = current_direction;
-               }
        | LINE
        | LINE
-               {
-                 $$ = new object_spec(LINE_OBJECT);
-                 lookup_variable("lineht", & $$->segment_height);
-                 lookup_variable("linewid", & $$->segment_width);
-                 $$->dir = current_direction;
-               }
        | ARROW
        | ARROW
-               {
-                 $$ = new object_spec(ARROW_OBJECT);
-                 lookup_variable("lineht", & $$->segment_height);
-                 lookup_variable("linewid", & $$->segment_width);
-                 $$->dir = current_direction;
-               }
        | MOVE
        | MOVE
-               {
-                 $$ = new object_spec(MOVE_OBJECT);
-                 lookup_variable("moveht", & $$->segment_height);
-                 lookup_variable("movewid", & $$->segment_width);
-                 $$->dir = current_direction;
-               }
        | SPLINE
        | SPLINE
-               {
-                 $$ = new object_spec(SPLINE_OBJECT);
-                 lookup_variable("lineht", & $$->segment_height);
-                 lookup_variable("linewid", & $$->segment_width);
-                 $$->dir = current_direction;
-               }
        | text                                                  %prec TEXT
        | text                                                  %prec TEXT
-               {
-                 $$ = new object_spec(TEXT_OBJECT);
-                 $$->text = new text_item($1.str, $1.filename, $1.lineno);
-               }
        | PLOT expr
        | PLOT expr
-               {
-                 $$ = new object_spec(TEXT_OBJECT);
-                 $$->text = new text_item(format_number(0, $2), 0, -1);
-               }
        | PLOT expr text
        | PLOT expr text
-               {
-                 $$ = new object_spec(TEXT_OBJECT);
-                 $$->text = new text_item(format_number($3.str, $2),
-                                          $3.filename, $3.lineno);
-                 a_delete $3.str;
-               }
        | '['
        | '['
-               {
-                 saved_state *p = new saved_state;
-                 $<pstate>$ = p;
-                 p->x = current_position.x;
-                 p->y = current_position.y;
-                 p->dir = current_direction;
-                 p->tbl = current_table;
-                 p->prev = current_saved_state;
-                 current_position.x = 0.0;
-                 current_position.y = 0.0;
-                 current_table = new PTABLE(place);
-                 current_saved_state = p;
-                 olist.append(make_mark_object());
-               }
+               {}
          element_list ']'
          element_list ']'
-               {
-                 current_position.x = $<pstate>2->x;
-                 current_position.y = $<pstate>2->y;
-                 current_direction = $<pstate>2->dir;
-                 $$ = new object_spec(BLOCK_OBJECT);
-                 olist.wrap_up_block(& $$->oblist);
-                 $$->tbl = current_table;
-                 current_table = $<pstate>2->tbl;
-                 current_saved_state = $<pstate>2->prev;
-                 delete $<pstate>2;
-               }
        | object_spec HEIGHT expr
        | object_spec HEIGHT expr
-               {
-                 $$ = $1;
-                 $$->height = $3;
-                 $$->flags |= HAS_HEIGHT;
-               }
        | object_spec RADIUS expr
        | object_spec RADIUS expr
-               {
-                 $$ = $1;
-                 $$->radius = $3;
-                 $$->flags |= HAS_RADIUS;
-               }
        | object_spec WIDTH expr
        | object_spec WIDTH expr
-               {
-                 $$ = $1;
-                 $$->width = $3;
-                 $$->flags |= HAS_WIDTH;
-               }
        | object_spec DIAMETER expr
        | object_spec DIAMETER expr
-               {
-                 $$ = $1;
-                 $$->radius = $3/2.0;
-                 $$->flags |= HAS_RADIUS;
-               }
        | object_spec expr                                      %prec HEIGHT
        | object_spec expr                                      %prec HEIGHT
-               {
-                 $$ = $1;
-                 $$->flags |= HAS_SEGMENT;
-                 switch ($$->dir) {
-                 case UP_DIRECTION:
-                   $$->segment_pos.y += $2;
-                   break;
-                 case DOWN_DIRECTION:
-                   $$->segment_pos.y -= $2;
-                   break;
-                 case RIGHT_DIRECTION:
-                   $$->segment_pos.x += $2;
-                   break;
-                 case LEFT_DIRECTION:
-                   $$->segment_pos.x -= $2;
-                   break;
-                 }
-               }
        | object_spec UP
        | object_spec UP
-               {
-                 $$ = $1;
-                 $$->dir = UP_DIRECTION;
-                 $$->flags |= HAS_SEGMENT;
-                 $$->segment_pos.y += $$->segment_height;
-               }
        | object_spec UP expr
        | object_spec UP expr
-               {
-                 $$ = $1;
-                 $$->dir = UP_DIRECTION;
-                 $$->flags |= HAS_SEGMENT;
-                 $$->segment_pos.y += $3;
-               }
        | object_spec DOWN
        | object_spec DOWN
-               {
-                 $$ = $1;
-                 $$->dir = DOWN_DIRECTION;
-                 $$->flags |= HAS_SEGMENT;
-                 $$->segment_pos.y -= $$->segment_height;
-               }
        | object_spec DOWN expr
        | object_spec DOWN expr
-               {
-                 $$ = $1;
-                 $$->dir = DOWN_DIRECTION;
-                 $$->flags |= HAS_SEGMENT;
-                 $$->segment_pos.y -= $3;
-               }
        | object_spec RIGHT
        | object_spec RIGHT
-               {
-                 $$ = $1;
-                 $$->dir = RIGHT_DIRECTION;
-                 $$->flags |= HAS_SEGMENT;
-                 $$->segment_pos.x += $$->segment_width;
-               }
        | object_spec RIGHT expr
        | object_spec RIGHT expr
-               {
-                 $$ = $1;
-                 $$->dir = RIGHT_DIRECTION;
-                 $$->flags |= HAS_SEGMENT;
-                 $$->segment_pos.x += $3;
-               }
        | object_spec LEFT
        | object_spec LEFT
-               {
-                 $$ = $1;
-                 $$->dir = LEFT_DIRECTION;
-                 $$->flags |= HAS_SEGMENT;
-                 $$->segment_pos.x -= $$->segment_width;
-               }
        | object_spec LEFT expr
        | object_spec LEFT expr
-               {
-                 $$ = $1;
-                 $$->dir = LEFT_DIRECTION;
-                 $$->flags |= HAS_SEGMENT;
-                 $$->segment_pos.x -= $3;
-               }
        | object_spec FROM position
        | object_spec FROM position
-               {
-                 $$ = $1;
-                 $$->flags |= HAS_FROM;
-                 $$->from.x = $3.x;
-                 $$->from.y = $3.y;
-               }
        | object_spec TO position
        | object_spec TO position
-               {
-                 $$ = $1;
-                 if ($$->flags & HAS_SEGMENT)
-                   $$->segment_list = new segment($$->segment_pos,
-                                                  $$->segment_is_absolute,
-                                                  $$->segment_list);
-                 $$->flags |= HAS_SEGMENT;
-                 $$->segment_pos.x = $3.x;
-                 $$->segment_pos.y = $3.y;
-                 $$->segment_is_absolute = 1;
-                 $$->flags |= HAS_TO;
-                 $$->to.x = $3.x;
-                 $$->to.y = $3.y;
-               }
        | object_spec AT position
        | object_spec AT position
-               {
-                 $$ = $1;
-                 $$->flags |= HAS_AT;
-                 $$->at.x = $3.x;
-                 $$->at.y = $3.y;
-                 if ($$->type != ARC_OBJECT) {
-                   $$->flags |= HAS_FROM;
-                   $$->from.x = $3.x;
-                   $$->from.y = $3.y;
-                 }
-               }
        | object_spec WITH path
        | object_spec WITH path
-               {
-                 $$ = $1;
-                 $$->flags |= HAS_WITH;
-                 $$->with = $3;
-               }
        | object_spec WITH position                             %prec ','
        | object_spec WITH position                             %prec ','
-               {
-                 $$ = $1;
-                 $$->flags |= HAS_WITH;
-                 position pos;
-                 pos.x = $3.x;
-                 pos.y = $3.y;
-                 $$->with = new path(pos);
-               }
        | object_spec BY expr_pair
        | object_spec BY expr_pair
-               {
-                 $$ = $1;
-                 $$->flags |= HAS_SEGMENT;
-                 $$->segment_pos.x += $3.x;
-                 $$->segment_pos.y += $3.y;
-               }
        | object_spec THEN
        | object_spec THEN
-               {
-                 $$ = $1;
-                 if ($$->flags & HAS_SEGMENT) {
-                   $$->segment_list = new segment($$->segment_pos,
-                                                  $$->segment_is_absolute,
-                                                  $$->segment_list);
-                   $$->flags &= ~HAS_SEGMENT;
-                   $$->segment_pos.x = $$->segment_pos.y = 0.0;
-                   $$->segment_is_absolute = 0;
-                 }
-               }
        | object_spec SOLID
        | object_spec SOLID
-               {
-                 $$ = $1;      // nothing
-               }
        | object_spec DOTTED
        | object_spec DOTTED
-               {
-                 $$ = $1;
-                 $$->flags |= IS_DOTTED;
-                 lookup_variable("dashwid", & $$->dash_width);
-               }
        | object_spec DOTTED expr
        | object_spec DOTTED expr
-               {
-                 $$ = $1;
-                 $$->flags |= IS_DOTTED;
-                 $$->dash_width = $3;
-               }
        | object_spec DASHED
        | object_spec DASHED
-               {
-                 $$ = $1;
-                 $$->flags |= IS_DASHED;
-                 lookup_variable("dashwid", & $$->dash_width);
-               }
        | object_spec DASHED expr
        | object_spec DASHED expr
-               {
-                 $$ = $1;
-                 $$->flags |= IS_DASHED;
-                 $$->dash_width = $3;
-               }
        | object_spec FILL
        | object_spec FILL
-               {
-                 $$ = $1;
-                 $$->flags |= IS_DEFAULT_FILLED;
-               }
        | object_spec FILL expr
        | object_spec FILL expr
-               {
-                 $$ = $1;
-                 $$->flags |= IS_FILLED;
-                 $$->fill = $3;
-               }
        | object_spec SHADED text
        | object_spec SHADED text
-               {
-                 $$ = $1;
-                 $$->flags |= (IS_SHADED | IS_FILLED);
-                 $$->shaded = new char[strlen($3.str)+1];
-                 strcpy($$->shaded, $3.str);
-               }
        | object_spec COLORED text
        | object_spec COLORED text
-               {
-                 $$ = $1;
-                 $$->flags |= (IS_SHADED | IS_OUTLINED | IS_FILLED);
-                 $$->shaded = new char[strlen($3.str)+1];
-                 strcpy($$->shaded, $3.str);
-                 $$->outlined = new char[strlen($3.str)+1];
-                 strcpy($$->outlined, $3.str);
-               }
        | object_spec OUTLINED text
        | object_spec OUTLINED text
-               {
-                 $$ = $1;
-                 $$->flags |= IS_OUTLINED;
-                 $$->outlined = new char[strlen($3.str)+1];
-                 strcpy($$->outlined, $3.str);
-               }
        | object_spec CHOP
        | object_spec CHOP
-               {
-                 $$ = $1;
-                 // line chop chop means line chop 0 chop 0
-                 if ($$->flags & IS_DEFAULT_CHOPPED) {
-                   $$->flags |= IS_CHOPPED;
-                   $$->flags &= ~IS_DEFAULT_CHOPPED;
-                   $$->start_chop = $$->end_chop = 0.0;
-                 }
-                 else if ($$->flags & IS_CHOPPED) {
-                   $$->end_chop = 0.0;
-                 }
-                 else {
-                   $$->flags |= IS_DEFAULT_CHOPPED;
-                 }
-               }
        | object_spec CHOP expr
        | object_spec CHOP expr
-               {
-                 $$ = $1;
-                 if ($$->flags & IS_DEFAULT_CHOPPED) {
-                   $$->flags |= IS_CHOPPED;
-                   $$->flags &= ~IS_DEFAULT_CHOPPED;
-                   $$->start_chop = 0.0;
-                   $$->end_chop = $3;
-                 }
-                 else if ($$->flags & IS_CHOPPED) {
-                   $$->end_chop = $3;
-                 }
-                 else {
-                   $$->start_chop = $$->end_chop = $3;
-                   $$->flags |= IS_CHOPPED;
-                 }
-               }
        | object_spec SAME
        | object_spec SAME
-               {
-                 $$ = $1;
-                 $$->flags |= IS_SAME;
-               }
        | object_spec INVISIBLE
        | object_spec INVISIBLE
-               {
-                 $$ = $1;
-                 $$->flags |= IS_INVISIBLE;
-               }
        | object_spec LEFT_ARROW_HEAD
        | object_spec LEFT_ARROW_HEAD
-               {
-                 $$ = $1;
-                 $$->flags |= HAS_LEFT_ARROW_HEAD;
-               }
        | object_spec RIGHT_ARROW_HEAD
        | object_spec RIGHT_ARROW_HEAD
-               {
-                 $$ = $1;
-                 $$->flags |= HAS_RIGHT_ARROW_HEAD;
-               }
        | object_spec DOUBLE_ARROW_HEAD
        | object_spec DOUBLE_ARROW_HEAD
-               {
-                 $$ = $1;
-                 $$->flags |= (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD);
-               }
        | object_spec CW
        | object_spec CW
-               {
-                 $$ = $1;
-                 $$->flags |= IS_CLOCKWISE;
-               }
        | object_spec CCW
        | object_spec CCW
-               {
-                 $$ = $1;
-                 $$->flags &= ~IS_CLOCKWISE;
-               }
        | object_spec text                                      %prec TEXT
        | object_spec text                                      %prec TEXT
-               {
-                 $$ = $1;
-                 text_item **p;
-                 for (p = & $$->text; *p; p = &(*p)->next)
-                   ;
-                 *p = new text_item($2.str, $2.filename, $2.lineno);
-               }
        | object_spec LJUST
        | object_spec LJUST
-               {
-                 $$ = $1;
-                 if ($$->text) {
-                   text_item *p;
-                   for (p = $$->text; p->next; p = p->next)
-                     ;
-                   p->adj.h = LEFT_ADJUST;
-                 }
-               }
        | object_spec RJUST
        | object_spec RJUST
-               {
-                 $$ = $1;
-                 if ($$->text) {
-                   text_item *p;
-                   for (p = $$->text; p->next; p = p->next)
-                     ;
-                   p->adj.h = RIGHT_ADJUST;
-                 }
-               }
        | object_spec ABOVE
        | object_spec ABOVE
-               {
-                 $$ = $1;
-                 if ($$->text) {
-                   text_item *p;
-                   for (p = $$->text; p->next; p = p->next)
-                     ;
-                   p->adj.v = ABOVE_ADJUST;
-                 }
-               }
        | object_spec BELOW
        | object_spec BELOW
-               {
-                 $$ = $1;
-                 if ($$->text) {
-                   text_item *p;
-                   for (p = $$->text; p->next; p = p->next)
-                     ;
-                   p->adj.v = BELOW_ADJUST;
-                 }
-               }
        | object_spec THICKNESS expr
        | object_spec THICKNESS expr
-               {
-                 $$ = $1;
-                 $$->flags |= HAS_THICKNESS;
-                 $$->thickness = $3;
-               }
        | object_spec ALIGNED
        | object_spec ALIGNED
-               {
-                 $$ = $1;
-                 $$->flags |= IS_ALIGNED;
-               }
        ;
 
 text:
        TEXT
        ;
 
 text:
        TEXT
-               { $$ = $1; }
        | SPRINTF '(' TEXT sprintf_args ')'
        | SPRINTF '(' TEXT sprintf_args ')'
-               {
-                 $$.filename = $3.filename;
-                 $$.lineno = $3.lineno;
-                 $$.str = do_sprintf($3.str, $4.v, $4.nv);
-                 a_delete $4.v;
-                 a_delete $3.str;
-               }
        ;
 
 sprintf_args:
        /* empty */
        ;
 
 sprintf_args:
        /* empty */
-               {
-                 $$.v = 0;
-                 $$.nv = 0;
-                 $$.maxv = 0;
-               }
        | sprintf_args ',' expr
        | sprintf_args ',' expr
-               {
-                 $$ = $1;
-                 if ($$.nv >= $$.maxv) {
-                   if ($$.nv == 0) {
-                     $$.v = new double[4];
-                     $$.maxv = 4;
-                   }
-                   else {
-                     double *oldv = $$.v;
-                     $$.maxv *= 2;
-                     $$.v = new double[$$.maxv];
-                     memcpy($$.v, oldv, $$.nv*sizeof(double));
-                     a_delete oldv;
-                   }
-                 }
-                 $$.v[$$.nv] = $3;
-                 $$.nv += 1;
-               }
        ;
 
 position:
        position_not_place
        ;
 
 position:
        position_not_place
-               { $$ = $1; }
        | place
        | place
-               {
-                 position pos = $1;
-                 $$.x = pos.x;
-                 $$.y = pos.y;
-               }
        ;
 
 position_not_place:
        expr_pair
        ;
 
 position_not_place:
        expr_pair
-               { $$ = $1; }
        | position '+' expr_pair
        | position '+' expr_pair
-               {
-                 $$.x = $1.x + $3.x;
-                 $$.y = $1.y + $3.y;
-               }
        | position '-' expr_pair
        | position '-' expr_pair
-               {
-                 $$.x = $1.x - $3.x;
-                 $$.y = $1.y - $3.y;
-               }
        | '(' position ',' position ')'
        | '(' position ',' position ')'
-               {
-                 $$.x = $2.x;
-                 $$.y = $4.y;
-               }
        | expr between position AND position
        | expr between position AND position
-               {
-                 $$.x = (1.0 - $1)*$3.x + $1*$5.x;
-                 $$.y = (1.0 - $1)*$3.y + $1*$5.y;
-               }
        | expr '<' position ',' position '>'
        | expr '<' position ',' position '>'
-               {
-                 $$.x = (1.0 - $1)*$3.x + $1*$5.x;
-                 $$.y = (1.0 - $1)*$3.y + $1*$5.y;
-               }
        ;
 
 between:
        ;
 
 between:
@@ -2305,449 +1786,1331 @@ between:
 
 expr_pair:
        expr ',' expr
 
 expr_pair:
        expr ',' expr
-               {
-                 $$.x = $1;
-                 $$.y = $3;
-               }
        | '(' expr_pair ')'
        | '(' expr_pair ')'
-               { $$ = $2; }
        ;
 
 place:
        /* line at A left == line (at A) left */
        label                                                   %prec CHOP
        ;
 
 place:
        /* line at A left == line (at A) left */
        label                                                   %prec CHOP
-               { $$ = $1; }
        | label corner
        | label corner
-               {
-                 path pth($2);
-                 if (!pth.follow($1, & $$))
-                   YYABORT;
-               }
        | corner label
        | corner label
-               {
-                 path pth($1);
-                 if (!pth.follow($2, & $$))
-                   YYABORT;
-               }
        | corner OF label
        | corner OF label
-               {
-                 path pth($1);
-                 if (!pth.follow($3, & $$))
-                   YYABORT;
-               }
        | HERE
        | HERE
-               {
-                 $$.x = current_position.x;
-                 $$.y = current_position.y;
-                 $$.obj = 0;
-               }
        ;
 
 label:
        LABEL
        ;
 
 label:
        LABEL
-               {
-                 place *p = lookup_label($1);
-                 if (!p) {
-                   lex_error("there is no place `%1'", $1);
-                   YYABORT;
-                 }
-                 $$ = *p;
-                 a_delete $1;
-               }
        | nth_primitive
        | nth_primitive
-               { $$.obj = $1; }
        | label '.' LABEL
        | label '.' LABEL
-               {
-                 path pth($3);
-                 if (!pth.follow($1, & $$))
-                   YYABORT;
-               }
        ;
 
 ordinal:
        ORDINAL
        ;
 
 ordinal:
        ORDINAL
-               { $$ = $1; }
        | '`' any_expr TH
        | '`' any_expr TH
-               {
-                 // XXX Check for overflow (and non-integers?).
-                 $$ = (int)$2;
-               }
        ;
 
 optional_ordinal_last:
        LAST
        ;
 
 optional_ordinal_last:
        LAST
-               { $$ = 1; }
        | ordinal LAST
        | ordinal LAST
-               { $$ = $1; }
        ;
 
 nth_primitive:
        ordinal object_type
        ;
 
 nth_primitive:
        ordinal object_type
-               {
-                 int count = 0;
-                 object *p;
-                 for (p = olist.head; p != 0; p = p->next)
-                   if (p->type() == $2 && ++count == $1) {
-                     $$ = p;
-                     break;
-                   }
-                 if (p == 0) {
-                   lex_error("there is no %1%2 %3", $1, ordinal_postfix($1),
-                             object_type_name($2));
-                   YYABORT;
-                 }
-               }
        | optional_ordinal_last object_type
        | optional_ordinal_last object_type
-               {
-                 int count = 0;
-                 object *p;
-                 for (p = olist.tail; p != 0; p = p->prev)
-                   if (p->type() == $2 && ++count == $1) {
-                     $$ = p;
-                     break;
-                   }
-                 if (p == 0) {
-                   lex_error("there is no %1%2 last %3", $1,
-                             ordinal_postfix($1), object_type_name($2));
-                   YYABORT;
-                 }
-               }
        ;
 
 object_type:
        BOX
        ;
 
 object_type:
        BOX
-               { $$ = BOX_OBJECT; }
        | CIRCLE
        | CIRCLE
-               { $$ = CIRCLE_OBJECT; }
        | ELLIPSE
        | ELLIPSE
-               { $$ = ELLIPSE_OBJECT; }
        | ARC
        | ARC
-               { $$ = ARC_OBJECT; }
        | LINE
        | LINE
-               { $$ = LINE_OBJECT; }
        | ARROW
        | ARROW
-               { $$ = ARROW_OBJECT; }
        | SPLINE
        | SPLINE
-               { $$ = SPLINE_OBJECT; }
        | '[' ']'
        | '[' ']'
-               { $$ = BLOCK_OBJECT; }
        | TEXT
        | TEXT
-               { $$ = TEXT_OBJECT; }
        ;
 
 label_path:
        '.' LABEL
        ;
 
 label_path:
        '.' LABEL
-               { $$ = new path($2); }
        | label_path '.' LABEL
        | label_path '.' LABEL
-               {
-                 $$ = $1;
-                 $$->append($3);
-               }
        ;
 
 relative_path:
        corner                                                  %prec CHOP
        ;
 
 relative_path:
        corner                                                  %prec CHOP
-               { $$ = new path($1); }
        /* 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
        /* 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
-               { $$ = $1; }
        | label_path corner
        | label_path corner
-               {
-                 $$ = $1;
-                 $$->append($2);
-               }
        ;
 
 path:
        relative_path
        ;
 
 path:
        relative_path
-               { $$ = $1; }
        | '(' relative_path ',' relative_path ')'
        | '(' relative_path ',' relative_path ')'
-               {
-                 $$ = $2;
-                 $$->set_ypath($4);
-               }
+               {}
        /* The rest of these rules are a compatibility sop. */
        | ORDINAL LAST object_type relative_path
        /* The rest of these rules are a compatibility sop. */
        | ORDINAL LAST object_type relative_path
-               {
-                 lex_warning("`%1%2 last %3' in `with' argument ignored",
-                             $1, ordinal_postfix($1), object_type_name($3));
-                 $$ = $4;
-               }
        | LAST object_type relative_path
        | LAST object_type relative_path
-               {
-                 lex_warning("`last %1' in `with' argument ignored",
-                             object_type_name($2));
-                 $$ = $3;
-               }
        | ORDINAL object_type relative_path
        | ORDINAL object_type relative_path
-               {
-                 lex_warning("`%1%2 %3' in `with' argument ignored",
-                             $1, ordinal_postfix($1), object_type_name($2));
-                 $$ = $3;
-               }
        | LABEL relative_path
        | LABEL relative_path
-               {
-                 lex_warning("initial `%1' in `with' argument ignored", $1);
-                 a_delete $1;
-                 $$ = $2;
-               }
        ;
 
 corner:
        DOT_N
        ;
 
 corner:
        DOT_N
-               { $$ = &object::north; }
        | DOT_E
        | DOT_E
-               { $$ = &object::east; }
        | DOT_W
        | DOT_W
-               { $$ = &object::west; }
        | DOT_S
        | DOT_S
-               { $$ = &object::south; }
        | DOT_NE
        | DOT_NE
-               { $$ = &object::north_east; }
        | DOT_SE
        | DOT_SE
-               { $$ = &object:: south_east; }
        | DOT_NW
        | DOT_NW
-               { $$ = &object::north_west; }
        | DOT_SW
        | DOT_SW
-               { $$ = &object::south_west; }
        | DOT_C
        | DOT_C
-               { $$ = &object::center; }
        | DOT_START
        | DOT_START
-               { $$ = &object::start; }
        | DOT_END
        | DOT_END
-               { $$ = &object::end; }
        | TOP
        | TOP
-               { $$ = &object::north; }
        | BOTTOM
        | BOTTOM
-               { $$ = &object::south; }
        | LEFT
        | LEFT
-               { $$ = &object::west; }
        | RIGHT
        | RIGHT
-               { $$ = &object::east; }
        | UPPER LEFT
        | UPPER LEFT
-               { $$ = &object::north_west; }
        | LOWER LEFT
        | LOWER LEFT
-               { $$ = &object::south_west; }
        | UPPER RIGHT
        | UPPER RIGHT
-               { $$ = &object::north_east; }
        | LOWER RIGHT
        | LOWER RIGHT
-               { $$ = &object::south_east; }
        | LEFT_CORNER
        | LEFT_CORNER
-               { $$ = &object::west; }
        | RIGHT_CORNER
        | RIGHT_CORNER
-               { $$ = &object::east; }
        | UPPER LEFT_CORNER
        | UPPER LEFT_CORNER
-               { $$ = &object::north_west; }
        | LOWER LEFT_CORNER
        | LOWER LEFT_CORNER
-               { $$ = &object::south_west; }
        | UPPER RIGHT_CORNER
        | UPPER RIGHT_CORNER
-               { $$ = &object::north_east; }
        | LOWER RIGHT_CORNER
        | LOWER RIGHT_CORNER
-               { $$ = &object::south_east; }
        | NORTH
        | NORTH
-               { $$ = &object::north; }
        | SOUTH
        | SOUTH
-               { $$ = &object::south; }
        | EAST
        | EAST
-               { $$ = &object::east; }
        | WEST
        | WEST
-               { $$ = &object::west; }
        | CENTER
        | CENTER
-               { $$ = &object::center; }
        | START
        | START
-               { $$ = &object::start; }
        | END
        | END
-               { $$ = &object::end; }
        ;
 
 expr:
        VARIABLE
        ;
 
 expr:
        VARIABLE
-               {
-                 if (!lookup_variable($1, & $$)) {
-                   lex_error("there is no variable `%1'", $1);
-                   YYABORT;
-                 }
-                 a_delete $1;
-               }
        | NUMBER
        | NUMBER
-               { $$ = $1; }
        | place DOT_X
        | place DOT_X
-               {
-                 if ($1.obj != 0)
-                   $$ = $1.obj->origin().x;
-                 else
-                   $$ = $1.x;
-               }
        | place DOT_Y
        | place DOT_Y
-               {
-                 if ($1.obj != 0)
-                   $$ = $1.obj->origin().y;
-                 else
-                   $$ = $1.y;
-               }
        | place DOT_HT
        | place DOT_HT
-               {
-                 if ($1.obj != 0)
-                   $$ = $1.obj->height();
-                 else
-                   $$ = 0.0;
-               }
        | place DOT_WID
        | place DOT_WID
-               {
-                 if ($1.obj != 0)
-                   $$ = $1.obj->width();
-                 else
-                   $$ = 0.0;
-               }
        | place DOT_RAD
        | place DOT_RAD
-               {
-                 if ($1.obj != 0)
-                   $$ = $1.obj->radius();
-                 else
-                   $$ = 0.0;
-               }
        | expr '+' expr
        | expr '+' expr
-               { $$ = $1 + $3; }
        | expr '-' expr
        | expr '-' expr
-               { $$ = $1 - $3; }
        | expr '*' expr
        | expr '*' expr
-               { $$ = $1 * $3; }
        | expr '/' expr
        | expr '/' expr
-               {
-                 if ($3 == 0.0) {
-                   lex_error("division by zero");
-                   YYABORT;
-                 }
-                 $$ = $1/$3;
-               }
        | expr '%' expr
        | expr '%' expr
-               {
-                 if ($3 == 0.0) {
-                   lex_error("modulus by zero");
-                   YYABORT;
-                 }
-                 $$ = fmod($1, $3);
-               }
        | expr '^' expr
        | expr '^' expr
-               {
-                 errno = 0;
-                 $$ = pow($1, $3);
-                 if (errno == EDOM) {
-                   lex_error("arguments to `^' operator out of domain");
-                   YYABORT;
-                 }
-                 if (errno == ERANGE) {
-                   lex_error("result of `^' operator out of range");
-                   YYABORT;
-                 }
-               }
        | '-' expr                                              %prec '!'
        | '-' expr                                              %prec '!'
-               { $$ = -$2; }
        | '(' any_expr ')'
        | '(' any_expr ')'
-               { $$ = $2; }
        | SIN '(' any_expr ')'
        | SIN '(' any_expr ')'
-               {
-                 errno = 0;
-                 $$ = sin($3);
-                 if (errno == ERANGE) {
-                   lex_error("sin result out of range");
-                   YYABORT;
-                 }
-               }
        | COS '(' any_expr ')'
        | COS '(' any_expr ')'
-               {
-                 errno = 0;
-                 $$ = cos($3);
-                 if (errno == ERANGE) {
-                   lex_error("cos result out of range");
-                   YYABORT;
-                 }
-               }
        | ATAN2 '(' any_expr ',' any_expr ')'
        | ATAN2 '(' any_expr ',' any_expr ')'
-               {
-                 errno = 0;
-                 $$ = atan2($3, $5);
-                 if (errno == EDOM) {
-                   lex_error("atan2 argument out of domain");
-                   YYABORT;
-                 }
-                 if (errno == ERANGE) {
-                   lex_error("atan2 result out of range");
-                   YYABORT;
-                 }
-               }
        | LOG '(' any_expr ')'
        | LOG '(' any_expr ')'
-               {
-                 errno = 0;
-                 $$ = log10($3);
-                 if (errno == ERANGE) {
-                   lex_error("log result out of range");
-                   YYABORT;
-                 }
-               }
        | EXP '(' any_expr ')'
        | EXP '(' any_expr ')'
-               {
-                 errno = 0;
-                 $$ = pow(10.0, $3);
-                 if (errno == ERANGE) {
-                   lex_error("exp result out of range");
-                   YYABORT;
-                 }
-               }
        | SQRT '(' any_expr ')'
        | SQRT '(' any_expr ')'
-               {
-                 errno = 0;
-                 $$ = sqrt($3);
-                 if (errno == EDOM) {
-                   lex_error("sqrt argument out of domain");
-                   YYABORT;
-                 }
-               }
        | K_MAX '(' any_expr ',' any_expr ')'
        | K_MAX '(' any_expr ',' any_expr ')'
-               { $$ = $3 > $5 ? $3 : $5; }
        | K_MIN '(' any_expr ',' any_expr ')'
        | K_MIN '(' any_expr ',' any_expr ')'
-               { $$ = $3 < $5 ? $3 : $5; }
        | INT '(' any_expr ')'
        | INT '(' any_expr ')'
-               { $$ = floor($3); }
        | RAND '(' any_expr ')'
        | RAND '(' any_expr ')'
-               { $$ = 1.0 + floor(((rand()&0x7fff)/double(0x7fff))*$3); }
        | RAND '(' ')'
        | RAND '(' ')'
-               {
-                 /* return a random number in the range >=0, <1 */
-                 /* portable, but not very random */
-                 $$ = (rand() & 0x7fff) / double(0x8000);
-               }
        | SRAND '(' any_expr ')'
        | SRAND '(' any_expr ')'
-               {
-                 $$ = 0;
-                 srand((unsigned int)$3);
-               }
        | expr '<' expr
        | expr '<' expr
-               { $$ = ($1 < $3); }
        | expr LESSEQUAL expr
        | expr LESSEQUAL expr
-               { $$ = ($1 <= $3); }
        | expr '>' expr
        | expr '>' expr
-               { $$ = ($1 > $3); }
        | expr GREATEREQUAL expr
        | expr GREATEREQUAL expr
-               { $$ = ($1 >= $3); }
        | expr EQUALEQUAL expr
        | expr EQUALEQUAL expr
-               { $$ = ($1 == $3); }
        | expr NOTEQUAL expr
        | expr NOTEQUAL expr
-               { $$ = ($1 != $3); }
        | expr ANDAND expr
        | expr ANDAND expr
-               { $$ = ($1 != 0.0 && $3 != 0.0); }
        | expr OROR expr
        | expr OROR expr
-               { $$ = ($1 != 0.0 || $3 != 0.0); }
        | '!' expr
        | '!' expr
-               { $$ = ($2 == 0.0); }
-
        ;
        ;
-]])
-
-# Pass plenty of options, to exercise plenty of code, even if we
-# don't actually check the output.  But SEGV is watching us, and
-# so might do dmalloc.
-AT_CHECK([[bison --verbose --defines input.y]], 0, [], [])
-
-AT_CLEANUP
+]],
+
+dnl INPUT
+dnl
+dnl For example, in pic:
+dnl
+dnl   .PS
+dnl   A: circle "A"
+dnl   B: A left
+dnl   circle "B" at B
+dnl   .PE
+dnl
+dnl Even using groff 1.19.2, the 3rd line above is a syntax error.  Change
+dnl "left" to "right", and it still is.  However, add "upper" or "lower" before
+dnl "left or "right" and it's accepted to mean ".nw", ".ne", ".sw", or ".se".
+dnl (There seem to be no aliases for "north" and "south" that can stand alone
+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
+]],
+
+dnl LAST-STATE
+[AT_COND_CASE([[LALR]], [[422]], [[canonical LR]], [[4833]], [[427]])],
+
+dnl LALR1-DIFF not used for canonical LR(1) because the diff is huge.
+dnl Isocore map from LALR(1) state number to new state number plus descriptions
+dnl of any change in the actions resulting in a change in accepted language:
+dnl   - 102 -> 423: reduce -> shift on LEFT and RIGHT
+dnl   - 237 -> 425
+dnl   - 266 -> 424
+dnl   - 339 -> 426
+dnl   - 383 -> 427
+[AT_COND_CASE([[LALR]], [],
+[[@@ -1223,7 +1223,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -1377,7 +1377,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -1854,7 +1854,7 @@
+
+     text                   go to state 162
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -2047,7 +2047,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -2571,7 +2571,7 @@
+     position_not_place     go to state 99
+     expr_pair              go to state 191
+     place                  go to state 101
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -2732,7 +2732,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -2875,7 +2875,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -3018,7 +3018,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -3256,7 +3256,7 @@
+
+ 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, '(', '`', '+', '-', '!', ';', '}', '@:>@']
+   147      | label . corner
+   153 label: label . '.' LABEL
+   180 corner: . DOT_N
+@@ -3645,7 +3645,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -3804,7 +3804,7 @@
+     text_expr              go to state 239
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -4481,7 +4481,7 @@
+     $default  reduce using rule 89 (object_spec)
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -4673,7 +4673,7 @@
+     $default  reduce using rule 91 (object_spec)
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -4867,7 +4867,7 @@
+     $default  reduce using rule 95 (object_spec)
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -5065,7 +5065,7 @@
+     $default  reduce using rule 93 (object_spec)
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -5260,7 +5260,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -5403,7 +5403,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -5546,7 +5546,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -5689,7 +5689,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -6475,7 +6475,7 @@
+
+     expr_pair              go to state 280
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -6633,7 +6633,7 @@
+     $default  reduce using rule 105 (object_spec)
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -6825,7 +6825,7 @@
+     $default  reduce using rule 107 (object_spec)
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -7017,7 +7017,7 @@
+     $default  reduce using rule 114 (object_spec)
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -7264,7 +7264,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -7408,7 +7408,7 @@
+     $default  reduce using rule 109 (object_spec)
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -7819,12 +7819,12 @@
+     position_not_place     go to state 296
+     expr_pair              go to state 100
+     place                  go to state 297
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+     corner                 go to state 106
+-    expr                   go to state 266
++    expr                   go to state 424
+
+
+ state 165
+@@ -7987,7 +7987,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -8172,7 +8172,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -8333,7 +8333,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -8494,7 +8494,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -8655,7 +8655,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -8816,7 +8816,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -8977,7 +8977,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -9138,7 +9138,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -9299,7 +9299,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -9460,7 +9460,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -9623,7 +9623,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -9784,7 +9784,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -9921,7 +9921,7 @@
+
+     $default  reduce using rule 47 (any_expr)
+
+-    between  go to state 237
++    between  go to state 425
+
+
+ state 193
+@@ -10152,7 +10152,7 @@
+
+     expr_pair              go to state 317
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -10298,7 +10298,7 @@
+
+     expr_pair              go to state 318
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -10622,7 +10622,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -10765,7 +10765,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -10908,7 +10908,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -11051,7 +11051,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -11194,7 +11194,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -11337,7 +11337,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -11480,7 +11480,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -11637,7 +11637,7 @@
+     position_not_place     go to state 99
+     expr_pair              go to state 100
+     place                  go to state 101
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -11780,7 +11780,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -11923,7 +11923,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -12066,7 +12066,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -12209,7 +12209,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -12352,7 +12352,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -12495,7 +12495,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -12638,7 +12638,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -12794,12 +12794,12 @@
+     position_not_place     go to state 99
+     expr_pair              go to state 100
+     place                  go to state 101
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+     corner                 go to state 106
+-    expr                   go to state 266
++    expr                   go to state 424
+
+
+ state 238
+@@ -12937,7 +12937,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -13160,7 +13160,7 @@
+     text_expr              go to state 342
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -13319,7 +13319,7 @@
+     text_expr              go to state 344
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -13502,7 +13502,7 @@
+     text_expr              go to state 348
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -13661,7 +13661,7 @@
+     text_expr              go to state 350
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -13804,7 +13804,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -14747,7 +14747,7 @@
+     position_not_place     go to state 99
+     expr_pair              go to state 191
+     place                  go to state 101
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -15074,7 +15074,7 @@
+     text                   go to state 113
+     expr_pair              go to state 365
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -15693,12 +15693,12 @@
+     position_not_place     go to state 99
+     expr_pair              go to state 100
+     place                  go to state 101
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+     corner                 go to state 106
+-    expr                   go to state 266
++    expr                   go to state 424
+
+
+ state 315
+@@ -16124,7 +16124,7 @@
+
+     $default  reduce using rule 239 (expr)
+
+-    between  go to state 237
++    between  go to state 425
+
+     Conflict between rule 239 and token OF resolved as shift ('<' < OF).
+     Conflict between rule 239 and token BETWEEN resolved as shift ('<' < BETWEEN).
+@@ -17234,7 +17234,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -17416,7 +17416,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -17577,7 +17577,7 @@
+     text_expr              go to state 112
+     text                   go to state 113
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -17772,12 +17772,12 @@
+     position_not_place     go to state 99
+     expr_pair              go to state 100
+     place                  go to state 101
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+     corner                 go to state 106
+-    expr                   go to state 266
++    expr                   go to state 424
+
+
+ state 383
+@@ -18071,7 +18071,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -18221,7 +18221,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -18830,7 +18830,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -18987,7 +18987,7 @@
+     '!'           shift, and go to state 94
+
+     place                  go to state 114
+-    label                  go to state 102
++    label                  go to state 423
+     ordinal                go to state 103
+     optional_ordinal_last  go to state 104
+     nth_primitive          go to state 105
+@@ -19089,3 +19089,440 @@
+    29 placeless_element: FOR VARIABLE '=' expr TO expr optional_by DO $@6 DELIMITED .
+
+     $default  reduce using rule 29 (placeless_element)
++
++
++state 423
++
++  146 place: label .  [$end, AND, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, ',', '>', '+', '-', ';', '}', '@:>@', ')']
++  147      | label . corner
++  153 label: label . '.' LABEL
++  180 corner: . DOT_N
++  181       | . DOT_E
++  182       | . DOT_W
++  183       | . DOT_S
++  184       | . DOT_NE
++  185       | . DOT_SE
++  186       | . DOT_NW
++  187       | . DOT_SW
++  188       | . DOT_C
++  189       | . DOT_START
++  190       | . DOT_END
++  191       | . TOP
++  192       | . BOTTOM
++  193       | . LEFT
++  194       | . RIGHT
++  195       | . UPPER LEFT
++  196       | . LOWER LEFT
++  197       | . UPPER RIGHT
++  198       | . LOWER RIGHT
++  199       | . LEFT_CORNER
++  200       | . RIGHT_CORNER
++  201       | . UPPER LEFT_CORNER
++  202       | . LOWER LEFT_CORNER
++  203       | . UPPER RIGHT_CORNER
++  204       | . LOWER RIGHT_CORNER
++  205       | . NORTH
++  206       | . SOUTH
++  207       | . EAST
++  208       | . WEST
++  209       | . CENTER
++  210       | . START
++  211       | . END
++
++    LEFT          shift, and go to state 53
++    RIGHT         shift, and go to state 54
++    DOT_N         shift, and go to state 56
++    DOT_E         shift, and go to state 57
++    DOT_W         shift, and go to state 58
++    DOT_S         shift, and go to state 59
++    DOT_NE        shift, and go to state 60
++    DOT_SE        shift, and go to state 61
++    DOT_NW        shift, and go to state 62
++    DOT_SW        shift, and go to state 63
++    DOT_C         shift, and go to state 64
++    DOT_START     shift, and go to state 65
++    DOT_END       shift, and go to state 66
++    TOP           shift, and go to state 78
++    BOTTOM        shift, and go to state 79
++    UPPER         shift, and go to state 80
++    LOWER         shift, and go to state 81
++    LEFT_CORNER   shift, and go to state 82
++    RIGHT_CORNER  shift, and go to state 83
++    NORTH         shift, and go to state 84
++    SOUTH         shift, and go to state 85
++    EAST          shift, and go to state 86
++    WEST          shift, and go to state 87
++    CENTER        shift, and go to state 88
++    END           shift, and go to state 89
++    START         shift, and go to state 90
++    '.'           shift, and go to state 204
++
++    $default  reduce using rule 146 (place)
++
++    corner  go to state 205
++
++
++state 424
++
++  140 position_not_place: expr . between position AND position
++  141                   | expr . '<' position ',' position '>'
++  142 between: . BETWEEN
++  143        | . OF THE WAY BETWEEN
++  144 expr_pair: expr . ',' expr
++  219 expr: expr . '+' expr
++  220     | expr . '-' expr
++  221     | expr . '*' expr
++  222     | expr . '/' expr
++  223     | expr . '%' expr
++  224     | expr . '^' expr
++  239     | expr . '<' expr
++  240     | expr . LESSEQUAL expr
++  241     | expr . '>' expr
++  242     | expr . GREATEREQUAL expr
++  243     | expr . EQUALEQUAL expr
++  244     | expr . NOTEQUAL expr
++  245     | expr . ANDAND expr
++  246     | expr . OROR expr
++
++    OF            shift, and go to state 220
++    BETWEEN       shift, and go to state 221
++    ANDAND        shift, and go to state 222
++    OROR          shift, and go to state 223
++    NOTEQUAL      shift, and go to state 224
++    EQUALEQUAL    shift, and go to state 225
++    LESSEQUAL     shift, and go to state 226
++    GREATEREQUAL  shift, and go to state 227
++    ','           shift, and go to state 228
++    '<'           shift, and go to state 229
++    '>'           shift, and go to state 230
++    '+'           shift, and go to state 231
++    '-'           shift, and go to state 232
++    '*'           shift, and go to state 233
++    '/'           shift, and go to state 234
++    '%'           shift, and go to state 235
++    '^'           shift, and go to state 236
++
++    between  go to state 425
++
++
++state 425
++
++  134 position: . position_not_place
++  135         | . place
++  136 position_not_place: . expr_pair
++  137                   | . position '+' expr_pair
++  138                   | . position '-' expr_pair
++  139                   | . '(' position ',' position ')'
++  140                   | . expr between position AND position
++  140                   | expr between . position AND position
++  141                   | . expr '<' position ',' position '>'
++  144 expr_pair: . expr ',' expr
++  145          | . '(' expr_pair ')'
++  146 place: . label
++  147      | . label corner
++  148      | . corner label
++  149      | . corner OF label
++  150      | . HERE
++  151 label: . LABEL
++  152      | . nth_primitive
++  153      | . label '.' LABEL
++  154 ordinal: . ORDINAL
++  155        | . '`' any_expr TH
++  156 optional_ordinal_last: . LAST
++  157                      | . ordinal LAST
++  158 nth_primitive: . ordinal object_type
++  159              | . optional_ordinal_last object_type
++  180 corner: . DOT_N
++  181       | . DOT_E
++  182       | . DOT_W
++  183       | . DOT_S
++  184       | . DOT_NE
++  185       | . DOT_SE
++  186       | . DOT_NW
++  187       | . DOT_SW
++  188       | . DOT_C
++  189       | . DOT_START
++  190       | . DOT_END
++  191       | . TOP
++  192       | . BOTTOM
++  193       | . LEFT
++  194       | . RIGHT
++  195       | . UPPER LEFT
++  196       | . LOWER LEFT
++  197       | . UPPER RIGHT
++  198       | . LOWER RIGHT
++  199       | . LEFT_CORNER
++  200       | . RIGHT_CORNER
++  201       | . UPPER LEFT_CORNER
++  202       | . LOWER LEFT_CORNER
++  203       | . UPPER RIGHT_CORNER
++  204       | . LOWER RIGHT_CORNER
++  205       | . NORTH
++  206       | . SOUTH
++  207       | . EAST
++  208       | . WEST
++  209       | . CENTER
++  210       | . START
++  211       | . END
++  212 expr: . VARIABLE
++  213     | . NUMBER
++  214     | . place DOT_X
++  215     | . place DOT_Y
++  216     | . place DOT_HT
++  217     | . place DOT_WID
++  218     | . place DOT_RAD
++  219     | . expr '+' expr
++  220     | . expr '-' expr
++  221     | . expr '*' expr
++  222     | . expr '/' expr
++  223     | . expr '%' expr
++  224     | . expr '^' expr
++  225     | . '-' expr
++  226     | . '(' any_expr ')'
++  227     | . SIN '(' any_expr ')'
++  228     | . COS '(' any_expr ')'
++  229     | . ATAN2 '(' any_expr ',' any_expr ')'
++  230     | . LOG '(' any_expr ')'
++  231     | . EXP '(' any_expr ')'
++  232     | . SQRT '(' any_expr ')'
++  233     | . K_MAX '(' any_expr ',' any_expr ')'
++  234     | . K_MIN '(' any_expr ',' any_expr ')'
++  235     | . INT '(' any_expr ')'
++  236     | . RAND '(' any_expr ')'
++  237     | . RAND '(' ')'
++  238     | . SRAND '(' any_expr ')'
++  239     | . expr '<' expr
++  240     | . expr LESSEQUAL expr
++  241     | . expr '>' expr
++  242     | . expr GREATEREQUAL expr
++  243     | . expr EQUALEQUAL expr
++  244     | . expr NOTEQUAL expr
++  245     | . expr ANDAND expr
++  246     | . expr OROR expr
++  247     | . '!' expr
++
++    LABEL         shift, and go to state 48
++    VARIABLE      shift, and go to state 49
++    NUMBER        shift, and go to state 50
++    ORDINAL       shift, and go to state 51
++    LAST          shift, and go to state 52
++    LEFT          shift, and go to state 53
++    RIGHT         shift, and go to state 54
++    HERE          shift, and go to state 55
++    DOT_N         shift, and go to state 56
++    DOT_E         shift, and go to state 57
++    DOT_W         shift, and go to state 58
++    DOT_S         shift, and go to state 59
++    DOT_NE        shift, and go to state 60
++    DOT_SE        shift, and go to state 61
++    DOT_NW        shift, and go to state 62
++    DOT_SW        shift, and go to state 63
++    DOT_C         shift, and go to state 64
++    DOT_START     shift, and go to state 65
++    DOT_END       shift, and go to state 66
++    SIN           shift, and go to state 67
++    COS           shift, and go to state 68
++    ATAN2         shift, and go to state 69
++    LOG           shift, and go to state 70
++    EXP           shift, and go to state 71
++    SQRT          shift, and go to state 72
++    K_MAX         shift, and go to state 73
++    K_MIN         shift, and go to state 74
++    INT           shift, and go to state 75
++    RAND          shift, and go to state 76
++    SRAND         shift, and go to state 77
++    TOP           shift, and go to state 78
++    BOTTOM        shift, and go to state 79
++    UPPER         shift, and go to state 80
++    LOWER         shift, and go to state 81
++    LEFT_CORNER   shift, and go to state 82
++    RIGHT_CORNER  shift, and go to state 83
++    NORTH         shift, and go to state 84
++    SOUTH         shift, and go to state 85
++    EAST          shift, and go to state 86
++    WEST          shift, and go to state 87
++    CENTER        shift, and go to state 88
++    END           shift, and go to state 89
++    START         shift, and go to state 90
++    '('           shift, and go to state 91
++    '`'           shift, and go to state 92
++    '-'           shift, and go to state 93
++    '!'           shift, and go to state 94
++
++    position               go to state 426
++    position_not_place     go to state 99
++    expr_pair              go to state 100
++    place                  go to state 101
++    label                  go to state 423
++    ordinal                go to state 103
++    optional_ordinal_last  go to state 104
++    nth_primitive          go to state 105
++    corner                 go to state 106
++    expr                   go to state 424
++
++
++state 426
++
++  137 position_not_place: position . '+' expr_pair
++  138                   | position . '-' expr_pair
++  140                   | expr between position . AND position
++
++    AND  shift, and go to state 427
++    '+'  shift, and go to state 197
++    '-'  shift, and go to state 198
++
++
++state 427
++
++  134 position: . position_not_place
++  135         | . place
++  136 position_not_place: . expr_pair
++  137                   | . position '+' expr_pair
++  138                   | . position '-' expr_pair
++  139                   | . '(' position ',' position ')'
++  140                   | . expr between position AND position
++  140                   | expr between position AND . position
++  141                   | . expr '<' position ',' position '>'
++  144 expr_pair: . expr ',' expr
++  145          | . '(' expr_pair ')'
++  146 place: . label
++  147      | . label corner
++  148      | . corner label
++  149      | . corner OF label
++  150      | . HERE
++  151 label: . LABEL
++  152      | . nth_primitive
++  153      | . label '.' LABEL
++  154 ordinal: . ORDINAL
++  155        | . '`' any_expr TH
++  156 optional_ordinal_last: . LAST
++  157                      | . ordinal LAST
++  158 nth_primitive: . ordinal object_type
++  159              | . optional_ordinal_last object_type
++  180 corner: . DOT_N
++  181       | . DOT_E
++  182       | . DOT_W
++  183       | . DOT_S
++  184       | . DOT_NE
++  185       | . DOT_SE
++  186       | . DOT_NW
++  187       | . DOT_SW
++  188       | . DOT_C
++  189       | . DOT_START
++  190       | . DOT_END
++  191       | . TOP
++  192       | . BOTTOM
++  193       | . LEFT
++  194       | . RIGHT
++  195       | . UPPER LEFT
++  196       | . LOWER LEFT
++  197       | . UPPER RIGHT
++  198       | . LOWER RIGHT
++  199       | . LEFT_CORNER
++  200       | . RIGHT_CORNER
++  201       | . UPPER LEFT_CORNER
++  202       | . LOWER LEFT_CORNER
++  203       | . UPPER RIGHT_CORNER
++  204       | . LOWER RIGHT_CORNER
++  205       | . NORTH
++  206       | . SOUTH
++  207       | . EAST
++  208       | . WEST
++  209       | . CENTER
++  210       | . START
++  211       | . END
++  212 expr: . VARIABLE
++  213     | . NUMBER
++  214     | . place DOT_X
++  215     | . place DOT_Y
++  216     | . place DOT_HT
++  217     | . place DOT_WID
++  218     | . place DOT_RAD
++  219     | . expr '+' expr
++  220     | . expr '-' expr
++  221     | . expr '*' expr
++  222     | . expr '/' expr
++  223     | . expr '%' expr
++  224     | . expr '^' expr
++  225     | . '-' expr
++  226     | . '(' any_expr ')'
++  227     | . SIN '(' any_expr ')'
++  228     | . COS '(' any_expr ')'
++  229     | . ATAN2 '(' any_expr ',' any_expr ')'
++  230     | . LOG '(' any_expr ')'
++  231     | . EXP '(' any_expr ')'
++  232     | . SQRT '(' any_expr ')'
++  233     | . K_MAX '(' any_expr ',' any_expr ')'
++  234     | . K_MIN '(' any_expr ',' any_expr ')'
++  235     | . INT '(' any_expr ')'
++  236     | . RAND '(' any_expr ')'
++  237     | . RAND '(' ')'
++  238     | . SRAND '(' any_expr ')'
++  239     | . expr '<' expr
++  240     | . expr LESSEQUAL expr
++  241     | . expr '>' expr
++  242     | . expr GREATEREQUAL expr
++  243     | . expr EQUALEQUAL expr
++  244     | . expr NOTEQUAL expr
++  245     | . expr ANDAND expr
++  246     | . expr OROR expr
++  247     | . '!' expr
++
++    LABEL         shift, and go to state 48
++    VARIABLE      shift, and go to state 49
++    NUMBER        shift, and go to state 50
++    ORDINAL       shift, and go to state 51
++    LAST          shift, and go to state 52
++    LEFT          shift, and go to state 53
++    RIGHT         shift, and go to state 54
++    HERE          shift, and go to state 55
++    DOT_N         shift, and go to state 56
++    DOT_E         shift, and go to state 57
++    DOT_W         shift, and go to state 58
++    DOT_S         shift, and go to state 59
++    DOT_NE        shift, and go to state 60
++    DOT_SE        shift, and go to state 61
++    DOT_NW        shift, and go to state 62
++    DOT_SW        shift, and go to state 63
++    DOT_C         shift, and go to state 64
++    DOT_START     shift, and go to state 65
++    DOT_END       shift, and go to state 66
++    SIN           shift, and go to state 67
++    COS           shift, and go to state 68
++    ATAN2         shift, and go to state 69
++    LOG           shift, and go to state 70
++    EXP           shift, and go to state 71
++    SQRT          shift, and go to state 72
++    K_MAX         shift, and go to state 73
++    K_MIN         shift, and go to state 74
++    INT           shift, and go to state 75
++    RAND          shift, and go to state 76
++    SRAND         shift, and go to state 77
++    TOP           shift, and go to state 78
++    BOTTOM        shift, and go to state 79
++    UPPER         shift, and go to state 80
++    LOWER         shift, and go to state 81
++    LEFT_CORNER   shift, and go to state 82
++    RIGHT_CORNER  shift, and go to state 83
++    NORTH         shift, and go to state 84
++    SOUTH         shift, and go to state 85
++    EAST          shift, and go to state 86
++    WEST          shift, and go to state 87
++    CENTER        shift, and go to state 88
++    END           shift, and go to state 89
++    START         shift, and go to state 90
++    '('           shift, and go to state 91
++    '`'           shift, and go to state 92
++    '-'           shift, and go to state 93
++    '!'           shift, and go to state 94
++
++    position               go to state 402
++    position_not_place     go to state 99
++    expr_pair              go to state 100
++    place                  go to state 101
++    label                  go to state 423
++    ordinal                go to state 103
++    optional_ordinal_last  go to state 104
++    nth_primitive          go to state 105
++    corner                 go to state 106
++    expr                   go to state 424
+]])],
+
+dnl OTHER-CHECKS
+[],
+
+dnl PARSER-EXIT-VALUE, PARSER-STDOUT, PARSER-STDERR
+[AT_COND_CASE([[LALR]], [[1]], [[0]])],
+[],
+[AT_COND_CASE([[LALR]],
+[[syntax error, unexpected LEFT
+]])])