Generating random but still valid expressions based on yacc / bison / ANTLR grammar

Is it possible? Is any tool available for this?

+5
source share
2 answers

yacc and bison turn your grammar into a state machine. You must be able to randomly move around the state machine to find valid inputs.

In principle, in each state, you can either transfer a new token to the stack, or switch to a new state, or reduce the upper token in the stack based on a set of valid abbreviations. (For more on how this works, see the Bison manual .

, , . , .

-v --report=state .

, - , .

+2

, . ANTLR YACC , . ANTLR ; . YACC , ; , , , .

/. .

, , . , - ; , . .

DMS Software Reengineering Toolkit [ ], , , , () . DMS , ( ). , , DMS; DMS- () , , , , .

, "", . , , , , , , .

+2

All Articles