I am struggling to understand yacc recursion. So I created a minimal language that I want to simply echo a list of number given to it. I am using JISON. Here is the JISON:
/* description: Parses end executes mathematical expressions. */
/* lexical grammar */
%lex
%%
\s+ /* skip whitespace */
[0-9]+("."[0-9]+)?\b return 'NUMBER'
<<EOF>> return 'EOF'
. return 'INVALID'
/lex
%start expressions
%% /* language grammar */
expressions
: e EOF
{}
;
e
: NUMBER {}
| NUMBER e
;
What actions do I need to echo the list of numbers separated by blanks?