Add GNU bison input file jamexp.y and unit test program for generated jamexp.c
Note: jamexp.y uses GNU extensions of the YACC grammar as defined by GNU bison
Reverse-engineering steps and inputs:
* Write a unit test program (driver jamexp_gen.c) using a jamexp.c generated
from jamexp.y with bison and the test functions in jamexp_shrd.c
** Copy old jamexp.c to jamexp.y, remove generated tables and replace with
directives for the Bison parser generator.
** Use operator precedences from the Stapl specification [1] and the grammar
of the C language [2] to derive the grammar for the Stapl expression parser.
** Fix grammar errors by comparing the parser debug outputs with corresponding
outputs of the test driver for the non-generated jamexp.c
** Repeat until all tests succeed.
[1] http://www.jtagtest.com/pdf/jesd71_stapl.pdf
[2] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
Integration hints:
* must be compiled as a 32-bit executable ('gcc -m32' was used)
* 'export URJ_JAM_YYDEBUG=1' before calling the test driver will
generate parser debug information
* CPP options:
** -DURJ_JAM_YYDEBUG=1 # debug output from $(BISON_OUT_DIR)/jamexp.c
** --include config.h
** -Iinclude # "urjtag/gettext.h"
** -Isrc/stapl
** -Itests/stapl
** -I. # "tests/tap/macros.h" in tests/tap/basic.c/basic.h
** -I($BISON_OUT_DIR)
* Bison options:
** --report=all --warnings=all --debug --defines=$(BISON_OUT_DIR)/jamytab.h
* Source files:
** tests/stapl/jamexp_gen.c # defines main()
** src/stapl/jamarray.c
** src/stapl/jamcomp.c
** src/stapl/jamexec.c
** $(BISON_OUT_DIR)/jamexp.c
** src/stapl/jamheap.c
** src/stapl/jamjtag.c
** src/stapl/jamstack.c
** src/stapl/jamsym.c
** tests/stapl/jamexp_shrd.c
** tests/tap/basic.c
* Libraries:
** libm
Signed-off-by: Peter Pöschl <pp+ujt2208@nest-ai.de>