diff options
Diffstat (limited to 'lib/configuration')
| -rw-r--r-- | lib/configuration/all_errors | 911 | ||||
| -rw-r--r-- | lib/configuration/ast.ml | 154 | ||||
| -rw-r--r-- | lib/configuration/ast.mli | 30 | ||||
| -rwxr-xr-x | lib/configuration/dune | 19 | ||||
| -rw-r--r-- | lib/configuration/expression_lexer.mll | 93 | ||||
| -rw-r--r-- | lib/configuration/expression_parser.messages | 0 | ||||
| -rw-r--r-- | lib/configuration/expression_parser.mly | 108 | ||||
| -rwxr-xr-x | lib/configuration/generate_errors.sh | 8 | ||||
| -rw-r--r-- | lib/configuration/graph_tree.ml | 71 | ||||
| -rw-r--r-- | lib/configuration/graph_tree.mli | 25 | ||||
| -rw-r--r-- | lib/configuration/json5.ml | 54 | ||||
| -rw-r--r-- | lib/configuration/parser.ml | 118 | ||||
| -rw-r--r-- | lib/configuration/read_conf.ml | 158 | ||||
| -rw-r--r-- | lib/configuration/read_conf.mli | 9 | ||||
| -rw-r--r-- | lib/configuration/tests/configuration.t | 77 | ||||
| -rw-r--r-- | lib/configuration/tests/dune | 11 | ||||
| -rw-r--r-- | lib/configuration/tests/errors.t | 119 | ||||
| -rw-r--r-- | lib/configuration/tests/tree.t | 161 | ||||
| -rw-r--r-- | lib/configuration/toml.ml_ | 133 | ||||
| -rw-r--r-- | lib/configuration/toml.mli_ | 1 |
20 files changed, 2260 insertions, 0 deletions
diff --git a/lib/configuration/all_errors b/lib/configuration/all_errors new file mode 100644 index 0000000..737023d --- /dev/null +++ b/lib/configuration/all_errors @@ -0,0 +1,911 @@ +path_expr: R_PAREN +## +## Ends in an error in state: 0. +## +## path_expr' -> . path_expr [ # ] +## +## The known suffix of the stack is as follows: +## +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN R_PAREN +## +## Ends in an error in state: 1. +## +## expr_(path_,EOF) -> L_PAREN . expr_(path_,R_PAREN) R_PAREN [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## L_PAREN +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN L_PAREN R_PAREN +## +## Ends in an error in state: 2. +## +## expr_(path_,R_PAREN) -> L_PAREN . expr_(path_,R_PAREN) R_PAREN [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## L_PAREN +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN IDENT R_PAREN +## +## Ends in an error in state: 5. +## +## expr_(path_,R_PAREN) -> IDENT . arguments(path_) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> IDENT . L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA group(path_) R_PAREN [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN IDENT L_PAREN R_BRACKET +## +## Ends in an error in state: 6. +## +## arguments(path_) -> L_PAREN . loption(separated_nonempty_list(COMA,expr_(path_,COMA))) R_PAREN [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> IDENT L_PAREN . option(opt_arg(path_,COMA)) group(path_) COMA group(path_) R_PAREN [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT L_PAREN +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR L_PAREN R_PAREN +## +## Ends in an error in state: 7. +## +## expr_(path_,COMA) -> L_PAREN . expr_(path_,R_PAREN) R_PAREN [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## L_PAREN +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: COLUMN R_PAREN +## +## Ends in an error in state: 8. +## +## path_ -> COLUMN . separated_nonempty_list(DOT,IDENT) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## COLUMN +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: COLUMN IDENT L_PAREN +## +## Ends in an error in state: 9. +## +## separated_nonempty_list(DOT,IDENT) -> IDENT . [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## separated_nonempty_list(DOT,IDENT) -> IDENT . DOT separated_nonempty_list(DOT,IDENT) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: COLUMN IDENT DOT R_PAREN +## +## Ends in an error in state: 10. +## +## separated_nonempty_list(DOT,IDENT) -> IDENT DOT . separated_nonempty_list(DOT,IDENT) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT DOT +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR L_PAREN INTEGER R_BRACKET +## +## Ends in an error in state: 15. +## +## expr_(path_,COMA) -> L_PAREN expr_(path_,R_PAREN) . R_PAREN [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . EQUALITY_OPERATOR group(path_) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## L_PAREN expr_(path_,R_PAREN) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN INTEGER INEQUALITY_OPERATOR R_PAREN +## +## Ends in an error in state: 17. +## +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) INEQUALITY_OPERATOR . expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,R_PAREN) INEQUALITY_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR IDENT R_PAREN +## +## Ends in an error in state: 18. +## +## expr_(path_,COMA) -> IDENT . arguments(path_) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> IDENT . L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA group(path_) R_PAREN [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR IDENT L_PAREN R_BRACKET +## +## Ends in an error in state: 19. +## +## arguments(path_) -> L_PAREN . loption(separated_nonempty_list(COMA,expr_(path_,COMA))) R_PAREN [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> IDENT L_PAREN . option(opt_arg(path_,COMA)) group(path_) COMA group(path_) R_PAREN [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT L_PAREN +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER EQUALITY_OPERATOR L_BRACKET R_PAREN +## +## Ends in an error in state: 23. +## +## group(path_) -> L_BRACKET . loption(separated_nonempty_list(COMA,expr_(path_,COMA))) R_BRACKET [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## L_BRACKET +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER EQUALITY_OPERATOR L_BRACKET INTEGER R_PAREN +## +## Ends in an error in state: 24. +## +## group(path_) -> L_BRACKET loption(separated_nonempty_list(COMA,expr_(path_,COMA))) . R_BRACKET [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## L_BRACKET loption(separated_nonempty_list(COMA,expr_(path_,COMA))) +## +## WARNING: This example involves spurious reductions. +## This implies that, although the LR(1) items shown above provide an +## accurate view of the past (what has been recognized so far), they +## may provide an INCOMPLETE view of the future (what was expected next). +## In state 27, spurious reduction of production separated_nonempty_list(COMA,expr_(path_,COMA)) -> expr_(path_,COMA) +## In state 20, spurious reduction of production loption(separated_nonempty_list(COMA,expr_(path_,COMA))) -> separated_nonempty_list(COMA,expr_(path_,COMA)) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER EQUALITY_OPERATOR L_BRACKET INTEGER EOF +## +## Ends in an error in state: 27. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## separated_nonempty_list(COMA,expr_(path_,COMA)) -> expr_(path_,COMA) . [ R_PAREN R_BRACKET ] +## separated_nonempty_list(COMA,expr_(path_,COMA)) -> expr_(path_,COMA) . COMA separated_nonempty_list(COMA,expr_(path_,COMA)) [ R_PAREN R_BRACKET ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR INTEGER INEQUALITY_OPERATOR R_PAREN +## +## Ends in an error in state: 28. +## +## expr_(path_,COMA) -> expr_(path_,COMA) INEQUALITY_OPERATOR . expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) INEQUALITY_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR INTEGER INEQUALITY_OPERATOR INTEGER L_PAREN +## +## Ends in an error in state: 29. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) INEQUALITY_OPERATOR expr_(path_,COMA) . [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) INEQUALITY_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR INTEGER EQUALITY_OPERATOR R_PAREN +## +## Ends in an error in state: 30. +## +## expr_(path_,COMA) -> expr_(path_,COMA) EQUALITY_OPERATOR . expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) EQUALITY_OPERATOR . group(path_) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) EQUALITY_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR INTEGER EQUALITY_OPERATOR INTEGER L_PAREN +## +## Ends in an error in state: 32. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) EQUALITY_OPERATOR expr_(path_,COMA) . [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) EQUALITY_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR INTEGER CONCAT_OPERATOR R_PAREN +## +## Ends in an error in state: 33. +## +## expr_(path_,COMA) -> expr_(path_,COMA) CONCAT_OPERATOR . expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) CONCAT_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR INTEGER CONCAT_OPERATOR INTEGER L_PAREN +## +## Ends in an error in state: 34. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) CONCAT_OPERATOR expr_(path_,COMA) . [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) CONCAT_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR INTEGER BINARY_OPERATOR R_PAREN +## +## Ends in an error in state: 35. +## +## expr_(path_,COMA) -> expr_(path_,COMA) BINARY_OPERATOR . expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) BINARY_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR INTEGER BINARY_OPERATOR INTEGER L_PAREN +## +## Ends in an error in state: 36. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) BINARY_OPERATOR expr_(path_,COMA) . [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) BINARY_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER EQUALITY_OPERATOR L_BRACKET INTEGER COMA R_PAREN +## +## Ends in an error in state: 37. +## +## separated_nonempty_list(COMA,expr_(path_,COMA)) -> expr_(path_,COMA) COMA . separated_nonempty_list(COMA,expr_(path_,COMA)) [ R_PAREN R_BRACKET ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) COMA +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR INTEGER BOOL_OPERATOR R_PAREN +## +## Ends in an error in state: 39. +## +## expr_(path_,COMA) -> expr_(path_,COMA) BOOL_OPERATOR . expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) BOOL_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR INTEGER BOOL_OPERATOR INTEGER L_PAREN +## +## Ends in an error in state: 40. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) BOOL_OPERATOR expr_(path_,COMA) . [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) BOOL_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR IDENT L_PAREN L_BRACKET R_BRACKET R_PAREN +## +## Ends in an error in state: 41. +## +## expr_(path_,COMA) -> IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) . COMA group(path_) R_PAREN [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR IDENT L_PAREN L_BRACKET R_BRACKET COMA R_PAREN +## +## Ends in an error in state: 42. +## +## expr_(path_,COMA) -> IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA . group(path_) R_PAREN [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR IDENT L_PAREN L_BRACKET R_BRACKET COMA L_BRACKET R_BRACKET R_BRACKET +## +## Ends in an error in state: 43. +## +## expr_(path_,COMA) -> IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA group(path_) . R_PAREN [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA group(path_) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: IDENT L_PAREN INTEGER COMA INTEGER R_BRACKET +## +## Ends in an error in state: 46. +## +## arguments(path_) -> L_PAREN loption(separated_nonempty_list(COMA,expr_(path_,COMA))) . R_PAREN [ R_PAREN R_BRACKET INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## L_PAREN loption(separated_nonempty_list(COMA,expr_(path_,COMA))) +## +## WARNING: This example involves spurious reductions. +## This implies that, although the LR(1) items shown above provide an +## accurate view of the past (what has been recognized so far), they +## may provide an INCOMPLETE view of the future (what was expected next). +## In state 27, spurious reduction of production separated_nonempty_list(COMA,expr_(path_,COMA)) -> expr_(path_,COMA) +## In state 38, spurious reduction of production separated_nonempty_list(COMA,expr_(path_,COMA)) -> expr_(path_,COMA) COMA separated_nonempty_list(COMA,expr_(path_,COMA)) +## In state 20, spurious reduction of production loption(separated_nonempty_list(COMA,expr_(path_,COMA))) -> separated_nonempty_list(COMA,expr_(path_,COMA)) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: IDENT L_PAREN INTEGER R_BRACKET +## +## Ends in an error in state: 48. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR COMA BOOL_OPERATOR BINARY_OPERATOR ] +## opt_arg(path_,COMA) -> expr_(path_,COMA) . COMA [ L_BRACKET ] +## separated_nonempty_list(COMA,expr_(path_,COMA)) -> expr_(path_,COMA) . [ R_PAREN ] +## separated_nonempty_list(COMA,expr_(path_,COMA)) -> expr_(path_,COMA) . COMA separated_nonempty_list(COMA,expr_(path_,COMA)) [ R_PAREN ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: IDENT L_PAREN INTEGER COMA R_PAREN +## +## Ends in an error in state: 49. +## +## opt_arg(path_,COMA) -> expr_(path_,COMA) COMA . [ L_BRACKET ] +## separated_nonempty_list(COMA,expr_(path_,COMA)) -> expr_(path_,COMA) COMA . separated_nonempty_list(COMA,expr_(path_,COMA)) [ R_PAREN ] +## +## The known suffix of the stack is as follows: +## expr_(path_,COMA) COMA +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN INTEGER INEQUALITY_OPERATOR INTEGER R_BRACKET +## +## Ends in an error in state: 51. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) INEQUALITY_OPERATOR expr_(path_,COMA) . [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,R_PAREN) INEQUALITY_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN INTEGER EQUALITY_OPERATOR R_PAREN +## +## Ends in an error in state: 52. +## +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) EQUALITY_OPERATOR . expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) EQUALITY_OPERATOR . group(path_) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,R_PAREN) EQUALITY_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN INTEGER EQUALITY_OPERATOR INTEGER R_BRACKET +## +## Ends in an error in state: 54. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) EQUALITY_OPERATOR expr_(path_,COMA) . [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,R_PAREN) EQUALITY_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN INTEGER CONCAT_OPERATOR R_PAREN +## +## Ends in an error in state: 55. +## +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) CONCAT_OPERATOR . expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,R_PAREN) CONCAT_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN INTEGER CONCAT_OPERATOR INTEGER R_BRACKET +## +## Ends in an error in state: 56. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) CONCAT_OPERATOR expr_(path_,COMA) . [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,R_PAREN) CONCAT_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN INTEGER BOOL_OPERATOR R_PAREN +## +## Ends in an error in state: 57. +## +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) BOOL_OPERATOR . expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,R_PAREN) BOOL_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN INTEGER BOOL_OPERATOR INTEGER R_BRACKET +## +## Ends in an error in state: 58. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) BOOL_OPERATOR expr_(path_,COMA) . [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,R_PAREN) BOOL_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN INTEGER BINARY_OPERATOR R_PAREN +## +## Ends in an error in state: 59. +## +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) BINARY_OPERATOR . expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,R_PAREN) BINARY_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN INTEGER BINARY_OPERATOR INTEGER R_BRACKET +## +## Ends in an error in state: 60. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) BINARY_OPERATOR expr_(path_,COMA) . [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,R_PAREN) BINARY_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN IDENT L_PAREN L_BRACKET R_BRACKET R_PAREN +## +## Ends in an error in state: 62. +## +## expr_(path_,R_PAREN) -> IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) . COMA group(path_) R_PAREN [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN IDENT L_PAREN L_BRACKET R_BRACKET COMA R_PAREN +## +## Ends in an error in state: 63. +## +## expr_(path_,R_PAREN) -> IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA . group(path_) R_PAREN [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN IDENT L_PAREN L_BRACKET R_BRACKET COMA L_BRACKET R_BRACKET R_BRACKET +## +## Ends in an error in state: 64. +## +## expr_(path_,R_PAREN) -> IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA group(path_) . R_PAREN [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA group(path_) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN L_PAREN INTEGER R_BRACKET +## +## Ends in an error in state: 67. +## +## expr_(path_,R_PAREN) -> L_PAREN expr_(path_,R_PAREN) . R_PAREN [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . EQUALITY_OPERATOR group(path_) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## L_PAREN expr_(path_,R_PAREN) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: L_PAREN INTEGER R_BRACKET +## +## Ends in an error in state: 69. +## +## expr_(path_,EOF) -> L_PAREN expr_(path_,R_PAREN) . R_PAREN [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . CONCAT_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . BINARY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . INEQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . EQUALITY_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . BOOL_OPERATOR expr_(path_,COMA) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,R_PAREN) -> expr_(path_,R_PAREN) . EQUALITY_OPERATOR group(path_) [ R_PAREN INEQUALITY_OPERATOR EQUALITY_OPERATOR CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## L_PAREN expr_(path_,R_PAREN) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: IDENT R_PAREN +## +## Ends in an error in state: 71. +## +## expr_(path_,EOF) -> IDENT . arguments(path_) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,EOF) -> IDENT . L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA group(path_) R_PAREN [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: IDENT L_PAREN R_BRACKET +## +## Ends in an error in state: 72. +## +## arguments(path_) -> L_PAREN . loption(separated_nonempty_list(COMA,expr_(path_,COMA))) R_PAREN [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,EOF) -> IDENT L_PAREN . option(opt_arg(path_,COMA)) group(path_) COMA group(path_) R_PAREN [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT L_PAREN +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: IDENT L_PAREN L_BRACKET R_BRACKET R_PAREN +## +## Ends in an error in state: 74. +## +## expr_(path_,EOF) -> IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) . COMA group(path_) R_PAREN [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: IDENT L_PAREN L_BRACKET R_BRACKET COMA R_PAREN +## +## Ends in an error in state: 75. +## +## expr_(path_,EOF) -> IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA . group(path_) R_PAREN [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: IDENT L_PAREN L_BRACKET R_BRACKET COMA L_BRACKET R_BRACKET R_BRACKET +## +## Ends in an error in state: 76. +## +## expr_(path_,EOF) -> IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA group(path_) . R_PAREN [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## IDENT L_PAREN option(opt_arg(path_,COMA)) group(path_) COMA group(path_) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER R_PAREN +## +## Ends in an error in state: 83. +## +## expr_(path_,EOF) -> expr_(path_,EOF) . CONCAT_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,EOF) -> expr_(path_,EOF) . BINARY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,EOF) -> expr_(path_,EOF) . INEQUALITY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,EOF) -> expr_(path_,EOF) . EQUALITY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,EOF) -> expr_(path_,EOF) . BOOL_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,EOF) -> expr_(path_,EOF) . EQUALITY_OPERATOR group(path_) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## path_expr -> expr_(path_,EOF) . EOF [ # ] +## +## The known suffix of the stack is as follows: +## expr_(path_,EOF) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER INEQUALITY_OPERATOR R_PAREN +## +## Ends in an error in state: 84. +## +## expr_(path_,EOF) -> expr_(path_,EOF) INEQUALITY_OPERATOR . expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,EOF) INEQUALITY_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER INEQUALITY_OPERATOR INTEGER R_PAREN +## +## Ends in an error in state: 85. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,EOF) -> expr_(path_,EOF) INEQUALITY_OPERATOR expr_(path_,COMA) . [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,EOF) INEQUALITY_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER EQUALITY_OPERATOR R_PAREN +## +## Ends in an error in state: 86. +## +## expr_(path_,EOF) -> expr_(path_,EOF) EQUALITY_OPERATOR . expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,EOF) -> expr_(path_,EOF) EQUALITY_OPERATOR . group(path_) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,EOF) EQUALITY_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER EQUALITY_OPERATOR INTEGER R_PAREN +## +## Ends in an error in state: 88. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,EOF) -> expr_(path_,EOF) EQUALITY_OPERATOR expr_(path_,COMA) . [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,EOF) EQUALITY_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER CONCAT_OPERATOR R_PAREN +## +## Ends in an error in state: 90. +## +## expr_(path_,EOF) -> expr_(path_,EOF) CONCAT_OPERATOR . expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,EOF) CONCAT_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER CONCAT_OPERATOR INTEGER R_PAREN +## +## Ends in an error in state: 91. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,EOF) -> expr_(path_,EOF) CONCAT_OPERATOR expr_(path_,COMA) . [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,EOF) CONCAT_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR R_PAREN +## +## Ends in an error in state: 92. +## +## expr_(path_,EOF) -> expr_(path_,EOF) BOOL_OPERATOR . expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,EOF) BOOL_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BOOL_OPERATOR INTEGER R_PAREN +## +## Ends in an error in state: 93. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,EOF) -> expr_(path_,EOF) BOOL_OPERATOR expr_(path_,COMA) . [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,EOF) BOOL_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BINARY_OPERATOR R_PAREN +## +## Ends in an error in state: 94. +## +## expr_(path_,EOF) -> expr_(path_,EOF) BINARY_OPERATOR . expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,EOF) BINARY_OPERATOR +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + +path_expr: INTEGER BINARY_OPERATOR INTEGER R_PAREN +## +## Ends in an error in state: 95. +## +## expr_(path_,COMA) -> expr_(path_,COMA) . CONCAT_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BINARY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . INEQUALITY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . BOOL_OPERATOR expr_(path_,COMA) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,COMA) -> expr_(path_,COMA) . EQUALITY_OPERATOR group(path_) [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## expr_(path_,EOF) -> expr_(path_,EOF) BINARY_OPERATOR expr_(path_,COMA) . [ INEQUALITY_OPERATOR EQUALITY_OPERATOR EOF CONCAT_OPERATOR BOOL_OPERATOR BINARY_OPERATOR ] +## +## The known suffix of the stack is as follows: +## expr_(path_,EOF) BINARY_OPERATOR expr_(path_,COMA) +## + +<YOUR SYNTAX ERROR MESSAGE HERE> + diff --git a/lib/configuration/ast.ml b/lib/configuration/ast.ml new file mode 100644 index 0000000..5857902 --- /dev/null +++ b/lib/configuration/ast.ml @@ -0,0 +1,154 @@ +open StdLabels + +module Splay = Splay.Make (struct + include String + + let pp = Format.pp_print_string +end) + +let escaped = String.escaped + +type list' = { id : string; source : string } + +type setting = { + mutable contents : Model.Reference.t Model.Content.t Splay.t; + lists : list' list; +} + +let init : unit -> setting = fun () -> { contents = Splay.empty (); lists = [] } + +(** Get the content from the setting. *) +let get_content : setting -> string -> Model.Reference.t Model.Content.t option + = + fun settings name -> Splay.find name settings.contents + +exception BrokenLink : ('a Type.Id.t * 'a * string) -> exn + +(** Convert the content having fields referencing element by name into content + having fields referencing other contents *) +let rec convert : + 'a Type.Id.t -> + setting -> + ('a * string) Model.Content.t -> + Model.Reference.t Model.Content.t = + fun ty setting content -> + let subcontents = + List.map (Model.Content.subcontents content) ~f:(convert ty setting) + in + let sections = + List.map + ~f:(fun section -> + let section' : Model.Reference.t Model.Section.t = + { + section with + fields = + List.map section.Model.Section.fields ~f:(fun field -> + Model.Field.map + (fun (value, name) -> + (* Raise a local exception here, which will be checked + later once the configuration will be completely + loaded *) + Model.Reference.v (fun () -> + match get_content setting name with + | Some v -> v + | None -> raise (BrokenLink (ty, value, name)))) + field); + } + in + section') + (Model.Content.sections content) + in + Model.Content.v (Model.Content.id content) sections subcontents + +(** Register a content and all the associated subcontent in the top level, + giving the possibility to fetch any content or subcontent by is’s name + without traversing the whole tree each time. *) +let register_content : + 'a Type.Id.t -> setting -> ('a * string) Model.Content.t -> unit = + fun ty setting content -> + let rec traverse content = + let () = + setting.contents <- + Splay.add (Model.Content.id content) content setting.contents + in + List.iter ~f:traverse (Model.Content.subcontents content) + in + traverse (convert ty setting content) + +let register_list : setting -> list' -> setting = + fun t l -> { t with lists = l :: t.lists } + +(** Force the evaluation of the field target and ensure it points to an existing + content in the application. + + Return the content targeted *) +let get_reference_target : + Model.Reference.t Model.Field.t -> Model.Reference.t Model.Content.t option + = + fun field -> + let (T ty) = Model.Field.type_ field in + match ty with + | Text -> None + | Integer -> None + | MonoReference r | MultiReference r -> ( + try Some (Model.Reference.get r.Model.Typ.t) + with BrokenLink _ as e -> raise_notrace e) + +(** Extract the other contents pointed by a given content, and the field used + for it. *) +let targeted_contents : + Model.Reference.t Model.Content.t -> + (Model.Reference.t Model.Field.t * Model.Reference.t Model.Content.t) Seq.t + = + fun t -> + Seq.filter_map + (fun field -> + match get_reference_target field with + | None -> None + | Some ref -> Some (field, ref)) + (Model.Content.fields t) + +let tree : ?required:bool -> setting -> Graph_tree.t = + fun ?(required = false) setting -> + let tree = Graph_tree.create () in + let () = + Splay.fold + (fun () (_, src) -> + let targets = targeted_contents src in + let root = Model.Content.root src in + Graph_tree.add_content tree root; + Seq.iter + (fun (field, dst) -> + (* We build the dependencies tree with the root contents only. + This does not change the logic, and this makes things easer + too *) + let add_edge = (not required) || Model.Field.required field in + match add_edge with + | false -> () + | true -> + Graph_tree.add_edge tree root field (Model.Content.root dst)) + targets) + () setting.contents + in + tree + +(** Return all the contents declared in the settings. + + The list provide the root contents in the topological order *) +let root_contents : setting -> Model.Reference.t Model.Content.t list = + fun setting -> Graph_tree.fold (fun a acc -> a :: acc) (tree setting) [] + +let check : setting -> (unit, exn) result = + fun setting -> + (* Ensure each content referenced exists. + + We accept mutually recursive dependancy and need to load all the content + first before checking the settings *) + try + let _ = tree setting in + + (* Check cycle dependencies *) + let required_tree = tree ~required:true setting in + Graph_tree.check_cycle required_tree; + Ok () + with e -> Error e diff --git a/lib/configuration/ast.mli b/lib/configuration/ast.mli new file mode 100644 index 0000000..5eda6f6 --- /dev/null +++ b/lib/configuration/ast.mli @@ -0,0 +1,30 @@ +type setting +type list' = { id : string; source : string } + +val init : unit -> setting + +val get_content : setting -> string -> Model.Reference.t Model.Content.t option +(** Get the content from the setting. *) + +val root_contents : setting -> Model.Reference.t Model.Content.t list +(** Extract all the content in the topological order. + + Only the root content are repored in the list *) + +val register_content : + 'a Type.Id.t -> setting -> ('a * string) Model.Content.t -> unit +(** Register a content and all the associated subcontent in the top level, + giving the possibility to fetch any content or subcontent by is’s name + without traversing the whole tree each time. *) + +exception BrokenLink : ('a Type.Id.t * 'a * string) -> exn +(** Exception raised when a reference in the configuration targets a + non-existing content *) + +val register_list : setting -> list' -> setting + +val check : setting -> (unit, exn) result +(** Check the setting and return the the error as an exception *) + +val tree : ?required:bool -> setting -> Graph_tree.t +val escaped : string -> string diff --git a/lib/configuration/dune b/lib/configuration/dune new file mode 100755 index 0000000..134a7dc --- /dev/null +++ b/lib/configuration/dune @@ -0,0 +1,19 @@ +(library + (name configuration) + (libraries menhirLib decoders yojson yojson-five ocamlgraph splay model) + (preprocess + (pps ppx_deriving.ord ppx_deriving.show ppx_deriving.eq))) + +(rule + (targets expression_parser_messages.ml) + (deps expression_parser.messages expression_parser.mly) + (action + (with-stdout-to + %{targets} + (run menhir --compile-errors %{deps})))) + +(menhir + (modules expression_parser) + (flags --table)) + +(ocamllex expression_lexer) diff --git a/lib/configuration/expression_lexer.mll b/lib/configuration/expression_lexer.mll new file mode 100644 index 0000000..1b4602a --- /dev/null +++ b/lib/configuration/expression_lexer.mll @@ -0,0 +1,93 @@ +{ + open Expression_parser + + exception UnclosedQuote of { content: string ; line : int} +} + + +let spaces = [ ' ' '\t' ] +let letters = [^ '$' '"' '\'' '(' ')' '[' ']' ':' '.' ',' '^' ' ' '\t' '\n' '\r' ] +let digit = [ '0'-'9' ] +let eol = [ '\r' '\n' ] + +let escaped = [ '\'' '\\'] + +rule token = parse +| eol { Lexing.new_line lexbuf; token lexbuf } +| spaces { token lexbuf } +| '\'' { + try read_quoted_string (Buffer.create 17) lexbuf + with Failure _ -> + let line = lexbuf.Lexing.lex_curr_p.pos_lnum + and content = Bytes.to_string lexbuf.Lexing.lex_buffer in + raise (UnclosedQuote {line; content}) +} +| '"' { read_dquoted_string (Buffer.create 17) lexbuf } +| '#' { skip_comment lexbuf } +| '(' { L_PAREN } +| ')' { R_PAREN } +| '[' { L_BRACKET } +| ']' { R_BRACKET } +| ':' { COLUMN } +| '$' { DOLLAR } +| '.' { DOT } +| ',' { COMA } +| '^' { CONCAT_OPERATOR } +| '+' { BINARY_OPERATOR (Model.Dsl.Add) } +| '-' { BINARY_OPERATOR (Model.Dsl.Minus) } +| '/' { BINARY_OPERATOR (Model.Dsl.Division) } +| "and" { BOOL_OPERATOR (Model.Dsl.And) } +| "or" { BOOL_OPERATOR (Model.Dsl.Or) } +| '<' { INEQUALITY_OPERATOR (Model.Dsl.LT) } +| "<=" { INEQUALITY_OPERATOR (Model.Dsl.LTE) } +| '>' { INEQUALITY_OPERATOR (Model.Dsl.GT) } +| ">=" { INEQUALITY_OPERATOR (Model.Dsl.GTE) } +| "<>" { EQUALITY_OPERATOR (Model.Dsl.Different) } +| '=' { EQUALITY_OPERATOR (Model.Dsl.Equal) } +| digit+ as l { INTEGER l} +| '-' digit+ as l { INTEGER l} +| letters+ as l { IDENT l} +| eof { EOF } + +and skip_comment = parse + | [^ '\r' '\n' ] + { skip_comment lexbuf } + | eol + { token lexbuf } + +(* Read the content until we got another one quote *) +and read_quoted_string buf = parse + | [^ '\'' '\\' ]+ + { Buffer.add_string buf (Lexing.lexeme lexbuf); + read_quoted_string buf lexbuf + } + | "\\\'" + { Buffer.add_char buf '\''; + read_quoted_string buf lexbuf + } + | '\\' + { Buffer.add_char buf '\\'; + read_quoted_string buf lexbuf + } + | '\'' + { LITERAL (Buffer.contents buf) + } + +(* Read the content until we got another one quote *) +and read_dquoted_string buf = parse + | [^ '"' '\\' ]+ + { Buffer.add_string buf (Lexing.lexeme lexbuf); + read_dquoted_string buf lexbuf + } + | "\\\"" + { Buffer.add_char buf '"'; + read_dquoted_string buf lexbuf + } + | '\\' + { Buffer.add_char buf '\\'; + read_dquoted_string buf lexbuf + } + | '"' + { + LITERAL (Buffer.contents buf) + } diff --git a/lib/configuration/expression_parser.messages b/lib/configuration/expression_parser.messages new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lib/configuration/expression_parser.messages diff --git a/lib/configuration/expression_parser.mly b/lib/configuration/expression_parser.mly new file mode 100644 index 0000000..8341362 --- /dev/null +++ b/lib/configuration/expression_parser.mly @@ -0,0 +1,108 @@ +%token <string>IDENT +%token L_PAREN +%token R_PAREN +%token L_BRACKET R_BRACKET +%token COLUMN DOLLAR +%token DOT +%token <string>LITERAL +%token <string>INTEGER +%token COMA +%token EOF +%token CONCAT_OPERATOR + +%token <Model.Dsl.binary_operator>BINARY_OPERATOR +%token <Model.Dsl.binary_operator>INEQUALITY_OPERATOR +%token <Model.Dsl.binary_operator>EQUALITY_OPERATOR +%token <Model.Dsl.binary_operator>BOOL_OPERATOR + +%start <string list Model.Dsl.t> path_expr + +%right BOOL_OPERATOR +%right INEQUALITY_OPERATOR EQUALITY_OPERATOR +%right CONCAT_OPERATOR BINARY_OPERATOR + +%% + +path_expr: + | expr_(path_, EOF) EOF { $1 } + | EOF { Model.Dsl.Empty } + +path_: + | COLUMN + path = separated_list(DOT, IDENT) + { Model.Dsl.ValuePath path } + | DOLLAR + path = separated_list(DOT, IDENT) + { Model.Dsl.ContentPath path } + +arguments(PATH): + | L_PAREN + expr = separated_list(COMA, expr_(PATH, COMA)) + R_PAREN + { expr } + +group(PATH): + | L_BRACKET + expr = separated_list(COMA, expr_(PATH, COMA)) + R_BRACKET + { expr } + +fixed(PATH): + | d = INTEGER + { Model.Dsl.Integer d } + | l = LITERAL + { + if String.equal String.empty l then + Model.Dsl.Empty + else + Model.Dsl.Literal l + } + +%inline boperator: + | e = BINARY_OPERATOR { e } + | e = INEQUALITY_OPERATOR { e } + | e = EQUALITY_OPERATOR { e } + | e = BOOL_OPERATOR { e } + +(* The expression evaluation receveive in parameters : + 1. the way to build a path, as we have two distinct ways to build them in + the case of externals (the external_key does not allow a table name) + 2. a phantom type telling wich kind of element will end the expression. + This can be EOF for the root expression, or COMA when inside a function. + This prevent merlin to optimize thoses two path, and allow more precise + error messages. *) +expr_(PATH, ENDING_PHANTOM): + | L_PAREN + e = expr_(PATH, R_PAREN) + R_PAREN + { Model.Dsl.Expr e + } + | + p1 = expr_(PATH, ENDING_PHANTOM) + CONCAT_OPERATOR + p2 = expr_(PATH, COMA) + { match p2 with + | Model.Dsl.Function(Concat, args) -> Model.Dsl.Function(Concat, (p1::args)) + | _ -> Model.Dsl.Function(Concat, (p1::p2::[])) + } + | p1 = expr_(PATH, ENDING_PHANTOM) + op = boperator + p2 = expr_(PATH, COMA) + { Model.Dsl.BOperator (op, p1, p2) } + + | p1 = expr_(PATH, ENDING_PHANTOM) + op = EQUALITY_OPERATOR + p2 = group(PATH) + { Model.Dsl.GEquality(op, p1, p2) } + | p = PATH + { p } + | f = fixed(PATH) + { f } + | s = IDENT + args = arguments(PATH) + { Model.Dsl.function_of_name args s } + +opt_arg(PATH, SEP): + | expr = expr_(PATH, COMA) + SEP + { expr } diff --git a/lib/configuration/generate_errors.sh b/lib/configuration/generate_errors.sh new file mode 100755 index 0000000..4c7233d --- /dev/null +++ b/lib/configuration/generate_errors.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Generate the error file with the helper messages. This script is required +# when the syntax is modified because menhir will change the state number and +# we need to make it match with the comment in the messages. + +menhir --list-errors *.mly --base expression_parser.mly > all_errors +menhir --merge-errors expression_parser.messages --merge-errors all_errors *.mly --base parser.mly > expression_parser.messages_new diff --git a/lib/configuration/graph_tree.ml b/lib/configuration/graph_tree.ml new file mode 100644 index 0000000..25c9366 --- /dev/null +++ b/lib/configuration/graph_tree.ml @@ -0,0 +1,71 @@ +(** Content graph + + Each content is associated with a vertex, and the links between each content + (through the references fields) are the graph vertexes. + + This module provide function for the topological order traversing, or the + cycle analysis. *) + +module Vertex = struct + type t = Model.Reference.t Model.Content.t + + let compare t1 t2 = String.compare (Model.Content.id t1) (Model.Content.id t2) + let equal t1 t2 = String.equal (Model.Content.id t1) (Model.Content.id t2) + let hash t = Hashtbl.hash (Model.Content.id t) +end + +module Edge = struct + type t = Default | Field of Model.Reference.t Model.Field.t + + let compare e1 e2 = + match (e1, e2) with + | Field f1, Field f2 -> + String.compare (Model.Field.name f1) (Model.Field.name f2) + | Default, Default -> 0 + | _, _ -> Stdlib.compare e1 e2 + + let default = Default +end + +module G = Graph.Imperative.Digraph.ConcreteLabeled (Vertex) (Edge) + +module GV_Printer = Graph.Graphviz.Dot (struct + include G + + let graph_attributes _ = [] + let vertex_name v = Model.Content.id v + let vertex_attributes _ = [] + let default_vertex_attributes _ = [] + let edge_attributes _ = [] + let default_edge_attributes _ = [] + let get_subgraph _ = None +end) + +module Topological = Graph.Topological.Make (G) +module Cycle = Graph.Cycles.Johnson (G) + +type t = G.t + +let create : unit -> t = G.create + +let add_edge : + t -> + Model.Reference.t Model.Content.t -> + Model.Reference.t Model.Field.t -> + Model.Reference.t Model.Content.t -> + unit = + fun t src field dst -> G.add_edge_e t (src, Edge.Field field, dst) + +let add_content : t -> Model.Reference.t Model.Content.t -> unit = G.add_vertex +let pp : Format.formatter -> t -> unit = GV_Printer.fprint_graph + +let fold : (Model.Reference.t Model.Content.t -> 'a -> 'a) -> t -> 'a -> 'a = + Topological.fold + +let iter : (Model.Reference.t Model.Content.t -> unit) -> t -> unit = + Topological.iter + +exception Cycle of Model.Reference.t Model.Content.t list + +let check_cycle : t -> unit = + fun t -> Cycle.iter_cycles (fun vertexes -> raise_notrace (Cycle vertexes)) t diff --git a/lib/configuration/graph_tree.mli b/lib/configuration/graph_tree.mli new file mode 100644 index 0000000..31a8f79 --- /dev/null +++ b/lib/configuration/graph_tree.mli @@ -0,0 +1,25 @@ +type t + +val create : unit -> t + +val add_content : t -> Model.Reference.t Model.Content.t -> unit +(** Add a new content in the tree *) + +val add_edge : + t -> + Model.Reference.t Model.Content.t -> + Model.Reference.t Model.Field.t -> + Model.Reference.t Model.Content.t -> + unit +(** Add a relation between two contents. + + The function does not check if the two contents are actually linked together +*) + +val pp : Format.formatter -> t -> unit +val fold : (Model.Reference.t Model.Content.t -> 'a -> 'a) -> t -> 'a -> 'a +val iter : (Model.Reference.t Model.Content.t -> unit) -> t -> unit + +exception Cycle of Model.Reference.t Model.Content.t list + +val check_cycle : t -> unit diff --git a/lib/configuration/json5.ml b/lib/configuration/json5.ml new file mode 100644 index 0000000..f6e182c --- /dev/null +++ b/lib/configuration/json5.ml @@ -0,0 +1,54 @@ +module Json_decodeable : + Decoders.Decode.Decodeable with type value = Yojson_five.Basic.t = struct + type value = Yojson_five.Basic.t + + let pp fmt json = Yojson.Basic.pretty_print fmt json + + let of_string : string -> (value, string) result = + fun string -> Yojson_five.Basic.from_string string + + let of_file file = Yojson_five.Basic.from_file file + let get_string = function `String value -> Some value | _ -> None + let get_int = function `Int value -> Some value | _ -> None + + let get_float = function + | `Float value -> Some value + | `Int value -> Some (float_of_int value) + | _ -> None + + let get_bool = function `Bool value -> Some value | _ -> None + let get_null = function `Null -> Some () | _ -> None + + let get_list : value -> value list option = function + | `List l -> Some l + | _ -> None + + let get_key_value_pairs : value -> (value * value) list option = function + | `Assoc assoc -> + Some (List.map (fun (key, value) -> (`String key, value)) assoc) + | _ -> None + + let to_list values = `List values +end + +module Decode = Decoders.Decode.Make (Json_decodeable) + +module Json_encodeable = struct + type value = Yojson_five.Basic.t + + let to_string json = Yojson_five.Basic.to_string json + let of_string x = `String x + let of_int x = `Int x + let of_float x = `Float x + let of_bool x = `Bool x + let null = `Null + let of_list xs = `List xs + + let of_key_value_pairs xs = + `Assoc + (xs + |> Decoders.Util.My_list.filter_map (fun (k, v) -> + match k with `String k -> Some (k, v) | _ -> None)) +end + +module Encode = Decoders.Encode.Make (Json_encodeable) diff --git a/lib/configuration/parser.ml b/lib/configuration/parser.ml new file mode 100644 index 0000000..bf962d9 --- /dev/null +++ b/lib/configuration/parser.ml @@ -0,0 +1,118 @@ +open StdLabels + +module ExpressionParser : sig + val of_string : string -> (string list Model.Dsl.t, string) result +end = struct + module MI = Expression_parser.MenhirInterpreter + module E = MenhirLib.ErrorReports + module L = MenhirLib.LexerUtil + + type error = { + message : string; + start_line : int; + start_pos : int; + end_pos : int; + } + + let range_message start_pos end_pos message = + let start_c = start_pos.Lexing.pos_cnum - start_pos.Lexing.pos_bol + and end_c = end_pos.Lexing.pos_cnum - end_pos.Lexing.pos_bol in + { + message; + start_line = start_pos.Lexing.pos_bol; + start_pos = start_c; + end_pos = end_c; + } + + (** Extract the line in error from the whole expression, and print some + characters just under the faulty part *) + let get_line_error : error -> string -> string = + fun error content -> + let sub_text = + try + let end_pos = String.index_from content error.start_line '\n' in + + String.sub content ~pos:error.start_line + ~len:(end_pos - error.start_line) + with Not_found -> + (* There is no new line, extract the ending part *) + let len = String.length content - error.start_line in + String.sub content ~pos:error.start_line ~len + in + (* I’m not sure how to produce it, but the error may be over two lines. + This line is here to prevent the underline to overflow. *) + let stop_pos = min error.end_pos (String.length sub_text) in + let error_length = stop_pos - error.start_pos in + String.concat ~sep:"" + [ + sub_text; + "\n"; + String.make error.start_pos ' '; + String.make error_length '^'; + ] + + let get_parse_error default_position env : error = + match MI.stack env with + | (lazy Nil) -> + range_message default_position.Lexing.lex_start_p + default_position.Lexing.lex_curr_p "Invalid syntax\n" + | (lazy (Cons (MI.Element (state, _, start_pos, end_pos), _))) -> + let message = + try Expression_parser_messages.message (MI.number state) + with Not_found -> + "Invalid syntax (no specific message for this eror)\n" + in + range_message start_pos end_pos message + + let rec _parse lexbuf (checkpoint : 'a Model.Dsl.t MI.checkpoint) = + match checkpoint with + | MI.InputNeeded _env -> + let token = Expression_lexer.token lexbuf in + let startp = lexbuf.lex_start_p and endp = lexbuf.lex_curr_p in + let checkpoint = MI.offer checkpoint (token, startp, endp) in + _parse lexbuf checkpoint + | MI.Shifting _ | MI.AboutToReduce _ -> + let checkpoint = MI.resume checkpoint in + _parse lexbuf checkpoint + | MI.HandlingError _env -> + let err = get_parse_error lexbuf _env in + Error err + | MI.Accepted v -> Ok v + | MI.Rejected -> + let err = + range_message lexbuf.lex_start_p lexbuf.lex_curr_p + "invalid syntax (parser rejected the input)" + in + Error err + + let of_string : string -> ('a Model.Dsl.t, string) result = + fun str_expression -> + let f = Expression_parser.Incremental.path_expr in + try + let lexbuf = Lexing.from_string str_expression in + let init = f lexbuf.lex_curr_p in + match _parse lexbuf init with + | Ok res -> Ok res + | Error e -> + let message = + String.concat ~sep:"\n" + [ e.message; get_line_error e str_expression ] + in + Error message + with + | Expression_lexer.UnclosedQuote { line; content } -> + let message = + Printf.sprintf "Unclosed quote at line %d : \"%s\"" line content + in + Error message + | Model.Dsl.UnknowFunction name -> + let message = + Printf.sprintf + "Unknown function or wrong number of arguments for '%s'" name + in + + Error message + | e -> + let message = Printexc.to_string e in + Error message +end diff --git a/lib/configuration/read_conf.ml b/lib/configuration/read_conf.ml new file mode 100644 index 0000000..f079e4e --- /dev/null +++ b/lib/configuration/read_conf.ml @@ -0,0 +1,158 @@ +open StdLabels + +module Make (S : Decoders.Decode.S) = struct + let ( let* ) = S.( let* ) + let ( and* ) = S.( and* ) + + (** Recursive type declaring a content and the subcontents *) + type declared_content = + | C of + string * (S.value * string) Model.Section.t list * declared_content list + + let rec content_builder : + declared_content -> (S.value * string) Model.Content.t = + fun c -> + let (C (content_id, sections, declared_subcontents)) = c in + let children = List.map declared_subcontents ~f:content_builder in + Model.Content.v content_id sections children + + (** [keep decoder] transform a decoder and keep the initial value with the + decoded value. + + This helps to build custom error message, if we want to report an error + from a different place. *) + let keep : 'a S.decoder -> (S.value * 'a) S.decoder = + fun decoder value -> S.map (fun v -> (value, v)) decoder value + + let textI18n : Model.Field.textI18n S.decoder = S.key_value_pairs S.string + + let dsl : string list Model.Dsl.t S.decoder = + let* content = S.string in + let dsl = Parser.ExpressionParser.of_string content in + Result.map_error Decoders.Error.make dsl |> S.from_result + + let field_type : (S.value * string) Model.Field.field_ex S.decoder = + let text_type : (S.value * string) Model.Field.field_ex S.decoder = + S.and_then + (fun value -> + match String.lowercase_ascii value with + | "text" -> S.succeed (Model.Field.T Text) + | "integer" -> S.succeed (Model.Field.T Integer) + | other -> S.fail other) + S.string + and content : (S.value * string) Model.Field.field_ex S.decoder = + let* content_t = keep @@ S.field "content" S.string + and* multivaluated = S.field_opt_or ~default:false "multivaluated" S.bool + and* constraints = S.field_opt "constraints" dsl in + + let reference = content_t in + + match multivaluated with + | true -> + S.succeed + (Model.Field.T (MultiReference { t = reference; constraints })) + | false -> + S.succeed + (Model.Field.T (MonoReference { t = reference; constraints })) + in + + S.one_of [ ("text", text_type); ("content", content) ] + + let validation : Model.Field.validation S.decoder = + let* rule = S.field "rule" dsl and* message = S.field "message" textI18n in + S.succeed Model.Field.{ rule; message } + + let field : (S.value * string) Model.Field.t S.decoder = + let* name = S.field "name" S.string + and* label = S.field "label" textI18n + and* type' = S.field "type" field_type + and* required = S.field_opt_or ~default:false "required" S.bool + and* placeholder = S.field_opt "placeholder" textI18n + and* validation = + S.field_opt_or ~default:[] "validation" (S.list validation) + and* criteria = S.field_opt "criteria" dsl in + let icon = None in + S.succeed + (Model.Field.create type' label ~required ?placeholder ~validation + ?criteria ?icon name) + + let section : (S.value * string) Model.Section.t S.decoder = + let* label = S.field_opt_or ~default:[] "label" textI18n + and* criteria = S.field_opt "criteria" dsl + and* fields = S.field "field" (S.list field) in + let icon = None in + S.succeed Model.Section.{ label; criteria; fields; icon } + + let identifier : string S.decoder = + let* id = S.string in + if String.equal String.empty id then + S.fail "Expected a non empty identifier" + else if String.contains id '.' then + S.fail "Expected an identifier with only the accepted characters" + else S.succeed id + + let content : (S.value * string) Model.Content.t S.decoder = + (* Build a temporary type without the parent information *) + let* c = + S.fix (fun content_decoder -> + let* id = S.field "id" identifier + and* sections = S.field_opt_or ~default:[] "section" (S.list section) + and* subcontents = + S.field_opt_or ~default:[] "subcontent" (S.list content_decoder) + in + let content = C (id, sections, subcontents) in + S.succeed content) + in + S.succeed (content_builder c) + + let list' : Ast.list' S.decoder = + let* id = S.field "id" S.string and* source = S.field "source" S.string in + S.succeed Ast.{ id; source } + + let t : Ast.setting S.decoder = + (* Register the data type to fetch it later *) + let ty : S.value Type.Id.t = Type.Id.make () in + + let settings = Ast.init () in + + let* contents = S.field "content" (S.list content) + (* Register the lists *) + and* lists = S.field_opt_or ~default:[] "list" (S.list list') in + let settings = List.fold_left lists ~init:settings ~f:Ast.register_list in + + let () = List.iter contents ~f:(Ast.register_content ty settings) in + + (* Ensure the settings are valid in the configuration *) + match Ast.check settings with + | Ok () -> S.succeed settings + | Error (Ast.BrokenLink (ty', context, name) as e) -> ( + match Type.Id.provably_equal ty ty' with + | None -> raise e + | Some Type.Equal -> + let message = + "Undefined target \"" ^ name + ^ "\". Expected existing list or content" + in + S.fail_with (Decoders.Error.make ~context message)) + | Error (Graph_tree.Cycle contents) -> + let content_name = List.map contents ~f:(fun c -> Model.Content.id c) in + let message = + String.concat ~sep:" " + ("Dependency circle found between:" :: content_name) + in + S.fail_with (Decoders.Error.make message) + | Error other -> raise other +end + +module ConfFormat = Json5.Decode +include Make (ConfFormat) + +type error = ConfFormat.error + +let read_conf : string -> (Ast.setting, error) result = + fun file -> ConfFormat.decode_file t file + +let pp_error = ConfFormat.pp_error + +let read_string_conf : string -> (Ast.setting, error) result = + fun file -> ConfFormat.decode_string t file diff --git a/lib/configuration/read_conf.mli b/lib/configuration/read_conf.mli new file mode 100644 index 0000000..3f2dde5 --- /dev/null +++ b/lib/configuration/read_conf.mli @@ -0,0 +1,9 @@ +type error = Json5.Decode.error + +val read_conf : string -> (Ast.setting, error) result +(** Read the configuration from a file *) + +val read_string_conf : string -> (Ast.setting, error) result +(** Read the configuration from a string *) + +val pp_error : Format.formatter -> error -> unit diff --git a/lib/configuration/tests/configuration.t b/lib/configuration/tests/configuration.t new file mode 100644 index 0000000..a732db6 --- /dev/null +++ b/lib/configuration/tests/configuration.t @@ -0,0 +1,77 @@ +The configuration is written in JSON5 format. + +Minimal configuration file with nothing: + + $ tests -configuration <<EOF + > { "content" : [] } + > + > EOF + + +Trailing coma are accepted: + + $ tests -configuration <<EOF + > { "content" : + > [ + > { + > "id": "entity", + > }, + > ] + > } + > + > EOF + +Comments are accepted: + + $ tests -configuration <<EOF + > { "content" : + > [ + > { + > // This is a comment in the file + > "id": "entity", + > } + > ] + > } + > + > EOF + +Cycles between elements are accepted when they are not mandatory to each other + + $ tests -configuration <<EOF + > { + > "content": [ + > { + > "id": "entity", + > "section": [ + > { + > "field": [ + > { + > "name": "user_type", + > "label": {}, + > "type": { + > "content": "user", + > "multivaluated": true + > } + > } + > ] + > } + > ] + > }, + > { + > "id": "user", + > "section": [ + > { + > "field": [ + > { + > "name": "entity", + > "label": {}, + > "type": { "content": "entity", } + > } + > ] + > } + > ] + > } + > ] + > } + + diff --git a/lib/configuration/tests/dune b/lib/configuration/tests/dune new file mode 100644 index 0000000..c5913da --- /dev/null +++ b/lib/configuration/tests/dune @@ -0,0 +1,11 @@ +; Add the test library in the path + +(env + (_ + (binaries %{project_root}/test/tests.exe))) + +; And depend of it. The binary will be available in the +; cram tests under the name "tests" + +(cram + (deps %{bin:tests})) diff --git a/lib/configuration/tests/errors.t b/lib/configuration/tests/errors.t new file mode 100644 index 0000000..6b5584e --- /dev/null +++ b/lib/configuration/tests/errors.t @@ -0,0 +1,119 @@ +Differents invalid configuration. All of them shall report the error properly + +Every content shall have an identifier + + $ tests -configuration <<EOF + > { + > "content": [ + > { + > "key": "", + > } + > ] + > } + > EOF + in field "content": + while decoding a list: + element 0: + Expected an object with an attribute "id", but got { "key": "" } + +The content ID cannot be empty: + + $ tests -configuration <<EOF + > { + > "content": [ + > { + > "id": "", + > } + > ] + > } + > EOF + in field "content": + while decoding a list: + element 0: in field "id": Expected a non empty identifier, but got "" + +The content ID cannot be contains "." (this charater is used internaly): + + $ tests -configuration <<EOF + > { + > "content": [ + > { + > "id": "foo.bar", + > } + > ] + > } + > EOF + in field "content": + while decoding a list: + element 0: + in field "id": + Expected an identifier with only the accepted characters, but got + "foo.bar" + +A reference shall point to an existing content: + + $ tests -configuration <<EOF + > { + > "content": [ + > { + > "id": "content", + > "section": [ + > { + > "field": [ + > { + > "name": "name", + > "label": {}, + > "type": { + > "content": "yes_no" + > } + > } + > ] + > } + > ] + > } + > ] + > } + > EOF + Undefined target "yes_no". Expected existing list or content, but got + { "content": "yes_no" } + +Cycles between required content are not accepted + + $ tests -configuration <<EOF + > { + > "content": [ + > { + > "id": "entity", + > "section": [ + > { + > "field": [ + > { + > "name": "user_type", + > "label": {}, + > "required": true, + > "type": { + > "content": "user", + > "multivaluated": true, + > } + > } + > ] + > } + > ] + > }, + > { + > "id": "user", + > "section": [ + > { + > "field": [ + > { + > "name": "entity", + > "label": {}, + > "required": true, + > "type": { "content": "entity", } + > } + > ] + > } + > ] + > } + > ] + > } + Dependency circle found between: entity user diff --git a/lib/configuration/tests/tree.t b/lib/configuration/tests/tree.t new file mode 100644 index 0000000..b69c830 --- /dev/null +++ b/lib/configuration/tests/tree.t @@ -0,0 +1,161 @@ +This test display the dependency tree between root contents after loading the +configuration. + +Each reference field introduce a dependency between the content having the field +and the content targeted by the field. + + $ tests -configuration -tree <<EOF + > { + > "content": [ + > { + > "id": "entity", + > "section": [ + > { + > "field": [ + > { + > "name": "user_type", + > "label": {}, + > "type": { + > "content": "user_type_list", + > "multivaluated": true + > } + > } + > ] + > } + > ] + > }, + > { + > "id": "user_type_list" + > } + > ] + > } + > EOF + digraph G { + entity; + user_type_list; + + + entity -> user_type_list; + + } + +The tree only contains root elements. Links between subcontent are reported as +link between their respective root content. + + $ tests -configuration -tree <<EOF + > { + > "content": [ + > { + > "id": "entity", + > "subcontent": [ + > { + > "id": "details", + > "section": [ + > { + > "field": [ + > { + > "name": "user_type", + > "label": {}, + > "type": { + > "content": "user_type_list", + > } + > } + > ] + > } + > ] + > } + > ] + > }, + > { + > "id": "user_type_list" + > } + > ] + > } + > EOF + digraph G { + entity; + user_type_list; + + + entity -> user_type_list; + + } + + $ tests -configuration -tree <<EOF + > { + > "content": [ + > { + > "id": "entity", + > "subcontent": [ + > { + > "id": "details", + > "section": [ + > { + > "field": [ + > { + > "name": "reference", + > "label": {}, + > "type": { "content": "user-details", } + > } + > ] + > } + > ] + > } + > ] + > }, + > { + > "id": "user_type_list", + > "subcontent": [ + > { + > "id": "user-details", + > } + > ] + > } + > ] + > } + > EOF + digraph G { + entity; + user_type_list; + + + entity -> user_type_list; + + } + +A content is allowed to loop to itself, directly or indirectly: + + $ tests -configuration -tree <<EOF + > { + > "content": [ + > { + > "id": "entity", + > "subcontent": [ + > { + > "id": "details", + > "section": [ + > { + > "field": [ + > { + > "name": "entities", + > "label": {}, + > "type": { "content": "entity", } + > } + > ] + > } + > ] + > } + > ] + > } + > ] + > } + > EOF + digraph G { + entity; + + + entity -> entity; + + } + + diff --git a/lib/configuration/toml.ml_ b/lib/configuration/toml.ml_ new file mode 100644 index 0000000..3648f2b --- /dev/null +++ b/lib/configuration/toml.ml_ @@ -0,0 +1,133 @@ +open StdLabels + +let rec pp : + ?topLevel:bool -> ?path:string list -> Format.formatter -> Otoml.t -> unit = + fun ?(topLevel = true) ?(path = []) format -> function + | Otoml.TomlString v -> begin + match String.contains v '\n' with + | false -> + Format.pp_print_string format "\""; + Format.pp_print_string format v; + Format.pp_print_string format "\"" + | true -> + Format.pp_print_string format {|"""|}; + Format.pp_print_text format v; + Format.pp_print_string format {|"""|} + end + | Otoml.TomlInteger i -> Format.pp_print_int format i + | Otoml.TomlFloat f -> Format.pp_print_float format f + | Otoml.TomlBoolean b -> Format.pp_print_bool format b + | Otoml.TomlArray l -> begin + match (topLevel, l) with + | _, [] -> Format.pp_print_string format "[]" + | false, _ -> Format.pp_print_string format "..." + | true, l -> + Format.pp_print_string format "["; + Format.pp_print_break format 0 4; + Format.pp_open_vbox format 0; + Format.pp_print_list + ~pp_sep:(fun f () -> + Format.pp_print_string f ","; + Format.pp_print_cut f ()) + pp format l; + Format.pp_close_box format (); + Format.pp_print_cut format (); + Format.pp_print_string format "]" + end + | Otoml.TomlTable elements | Otoml.TomlInlineTable elements -> + pp_table ~path format elements + | Otoml.TomlTableArray t -> Format.pp_print_list pp format t + | Otoml.TomlOffsetDateTime _ | Otoml.TomlLocalDate _ + | Otoml.TomlLocalDateTime _ | Otoml.TomlLocalTime _ -> + () + +and pp_key_values : Format.formatter -> string * Otoml.t -> unit = + fun format (name, value) -> + Format.fprintf format "%s = %a" name (pp ~topLevel:false ~path:[]) value + +and pp_table : + ?path:string list -> Format.formatter -> (string * Otoml.t) list -> unit = + fun ?(path = []) format elements -> + (* Create two lists, one for the subtables, and one for the values. + + As a table is valid until the next table, we then start to print the + preoperties before printintg the subtables inside the element. + *) + let subtables, properties = + List.partition elements ~f:(fun (_, v) -> + match v with Otoml.TomlTable _ -> true | _ -> false) + in + + let () = + match properties with + | [] -> () + | _ -> + let isTopLevel = match path with [] -> true | _ -> false in + if not isTopLevel then begin + let path = List.rev path in + Format.pp_print_cut format (); + Format.fprintf format "[%a]" + (Format.pp_print_list + ~pp_sep:(fun f () -> Format.pp_print_string f ".") + Format.pp_print_string) + path; + Format.pp_print_break format 0 4; + Format.pp_open_vbox format 0 + end; + if isTopLevel then begin + Format.pp_print_list ~pp_sep:Format.pp_print_cut + (fun format v -> + match v with + | key, Otoml.TomlTable elements -> + pp_table ~path:(key :: path) format elements + | other -> pp_key_values format other) + format properties + end + else begin + Format.pp_print_string format "..." + end; + + if not isTopLevel then begin + Format.pp_close_box format () + end; + Format.pp_print_cut format () + in + (* Then go deeper inside each subtable *) + List.iter subtables ~f:(function + | name, Otoml.TomlTable v -> pp_table ~path:(name :: path) format v + | _ -> (* Because of the partition, this should not happen *) ()) + +module Decode = struct + module S = struct + type value = Otoml.t + + let pp : Format.formatter -> value -> unit = + fun formatter v -> + Format.pp_open_vbox formatter 0; + pp formatter v; + Format.pp_close_box formatter () + + let of_string : string -> (value, string) result = + Otoml.Parser.from_string_result + + let of_file : string -> (value, string) result = + Otoml.Parser.from_file_result + + let get_string : value -> string option = Otoml.get_opt Otoml.get_string + let get_int : value -> int option = Otoml.get_opt Otoml.get_integer + let get_float : value -> float option = Otoml.get_opt Otoml.get_float + let get_bool : value -> bool option = Otoml.get_opt Otoml.get_boolean + let get_null : value -> unit option = fun _ -> None + + let get_list : value -> value list option = + Otoml.get_opt @@ Otoml.get_array Fun.id + + let get_key_value_pairs : value -> (value * value) list option = + Otoml.get_opt (fun key -> + Otoml.get_table key |> List.map ~f:(fun (k, v) -> (Otoml.string k, v))) + + let to_list : value list -> value = Otoml.array + end + + include Decoders.Decode.Make (S) +end diff --git a/lib/configuration/toml.mli_ b/lib/configuration/toml.mli_ new file mode 100644 index 0000000..08d30b8 --- /dev/null +++ b/lib/configuration/toml.mli_ @@ -0,0 +1 @@ +module Decode : Decoders.Decode.S with type value = Otoml.t |
