Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that the parse tool produces trees with the same structure as the generator #232

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

renatahodovan
Copy link
Owner

The parse trees generated by ANTLR consist only of rule nodes and do not contain information about the decisions made on alternations or quantifiers. However, tests generated by Grammarinator store such information in the form of alternative and quantifier nodes. To make these trees compatible, the current patch recreates the same structure that the generator produces in the trees obtained from parsed input.
The approach reuses the grammar graph implementation of processor, therefore it requires to define a lib_dir if included grammars are stored in a separate directory. To define such directories, similarily to grammarinator-process, grammarinator-parse also supports the --lib_dir CLI argument.

…the generator

The parse trees generated by ANTLR consist only of rule nodes and
do not contain information about the decisions made on alternations
or quantifiers. However, tests generated by Grammarinator store
such information in the form of alternative and quantifier nodes.
To make these trees compatible, the current patch recreates the
same structure that the generator produces in the trees obtained
from parsed input.
The approach reuses the grammar graph implementation of processor,
therefore it requires to define a lib_dir if included grammars
are stored in a separate directory. To define such directories,
similarily to grammarinator-process, grammarinator-parse also supports
the `--lib_dir` CLI argument.

Co-authored-by: Akos Kiss <[email protected]>
@renatahodovan renatahodovan requested a review from akosthekiss June 5, 2024 10:54
@coveralls
Copy link

Coverage Status

coverage: 85.614% (+1.8%) from 83.795%
when pulling b9e30cd on adjust-parse
into c0717df on master.

Copy link
Collaborator

@akosthekiss akosthekiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@akosthekiss akosthekiss merged commit 3840454 into master Jun 5, 2024
46 checks passed
@akosthekiss akosthekiss deleted the adjust-parse branch June 5, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants