codelion / gramtest

GramTest: A tool for Grammar based Test case generation
Apache License 2.0
85 stars 17 forks source link

Non-termination with a large program grammar #16

Open codelion opened 7 years ago

codelion commented 7 years ago

The following grammar leads to a non-termination in test case generation.

<program>      ::=   [<expr>]
<expr>         ::=   <id> | <method> | <rmethod> | <quote> | <label> | <string> | <tuple> | <block> | <seq> | <let>
<method>       ::=   "(" <method> <pattern> {<expr>} ")"
<rmethod>      ::=   "(" <rmethod> <pattern> {<expr>} ")"
<quote>        ::=   "'" <expr> "'"
<label>        ::=   "(" <label> <id> {<expr>} ")"
<string>       ::=   "this is a string"
<id>           ::=   <id> {<character>}
<tuple>        ::=   "[" [<expr>] "]" | "[" [<expr>] " & " <expr> "]"
<block>        ::=   "(" <block> {<expr>} ")"
<seq>          ::=   "(" <seq> {<expr>} ")"
<let>          ::=   "(" <let> [ "[" <id> <expr> "]"] {<expr>} ")" |
                        "(" <let>  "[" <pattern> <expr> "]"  {<expr>} ")"
<pattern>      ::=   ("[ " [<expr>] " ]") | ("[ " [<expr>] " & " <expr> " ]")

<character>    ::=   A | B | C | D | E | F | G | H | I | J | K | L | M | N |
                     O | P | Q | R | S | T | U | V | W | X | Y | Z |
                     a | b | c | d | e | f | g | h | i | j | k | l | m | n |
                     o | p | q | r | s | t | u | v | w | x | y | z