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

Add grammar spec option to control default state of debug #8

Open
mhhollomon opened this issue Jan 23, 2019 · 0 comments
Open

Add grammar spec option to control default state of debug #8

mhhollomon opened this issue Jan 23, 2019 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mhhollomon
Copy link
Owner

Currently, debug is turned off by default. allow the following options in the spec to default to on.

option lexer.debug true
option parser.debug true

It could still be switched off by the driver code.

@mhhollomon mhhollomon added the enhancement New feature or request label Jan 23, 2019
@mhhollomon mhhollomon added the good first issue Good for newcomers label Oct 8, 2019
mhhollomon added a commit that referenced this issue Oct 27, 2019
More work for enhancement #3 and #8
Add the infrastructure to parse option statements.
They don't currently get picked up by the analyzer.
mhhollomon added a commit that referenced this issue Nov 1, 2019
More work for enhancement #3 and #8
Add the infrastructure to parse option statements.
They don't currently get picked up by the analyzer.
mhhollomon added a commit that referenced this issue Nov 5, 2019
* Add associativity and precedence

You can now specify associativity and precedence for terms and
precedence for productions. These are used to resolve shift/reduce and
reduce/reduce conflicts in the grammar.

This completes issue #20

This commit also resolves issue #15 - moving the analyzer to use
error_info. More work needs to be done (globally) to use the nested
structure of error_info to its advantage, but this at least makes the
analyzer use the infrastructure.

* Fix up examples so they at least generate.

Many of the examples used older syntax or had things that wouldn't
parse. This commit fixes them so that they at least parse and generate
code. No work was done to make sure the grammars were in any sense
"correct".

In particular, the sqlite grammar has some known wrongness baked in.
These are marked in the grammar.

Along the way, some bugs in the parser and error reporting were also
fixed.

* Add install target

issue #23
The release target is only generated in Release mode. However it can be
explicitly requested buy setting the option YALR_ENABLE_INSTALL

~~~
cmake -B build -DYALR_ENABLE_INSTALL=ON
~~~

While at it, add options to control creating tests and examples.

* Add verbatim sections

Code for issue #21.
Changes to the calculator example to make use of the new statement.
Make some changes to the parser debug output to make the semantic stack
a bit more clear - could use some more work.

* Add precedence and assocativity statements

Add the new statement types and use then in the calculator.
This code also contains a partial implementation of a new termset
statement. I choose not to document at this time.

* Add @lexeme special type

enhancement #27

* Cleanup the state table output

enhancement #26 . Add a full list of tokens and productions, along with
any associated precedence and associativity.

* Add conflict information to the state table output

The table generator code now saves off the information needed to show
that a conflit happened and if it was resolved. The printer routine now
use that information to put out conflict info in the Action section of
the State descriptions.

* Add support for case insensitive match for regex

Partial support for enhancement #3.

You can now use `rf:` for folding (case insensitive) and `rm:` for
explicitly asking for case matching (case sensitive). This will be
needed when support is added for changing the default.

* Add support for case folded string compares.

Fixed string patterns can now be made case insensitive by using the
`@cfold` modifer. This also works for skips and regexes. The `rm:` and
`ri:` may be deprecated. It is an error to supply both.

* Parse option statement

More work for enhancement #3 and #8
Add the infrastructure to parse option statements.
They don't currently get picked up by the analyzer.

* Add new assert macro

Add a special `yassert` macro that takes a message argument.

Add a `yfail(mesg)` that acts like `yassert(false, mesg)`.

Note that these macros are NOT controlled by NDEBUG.

* Option flags for case matching behavior

enhancement #3. There are now two option flags to control the case
behavior of the lexer.

* Document new case options

finish out enhancement #3

* Fix bug #29

When creating the error message for the lack of a goal rule, no source
was being given. Add the source to the parse_tree so that we can
reference it in the analyzer. May need to push it on to the table gen
code as well.

* Small code cleanings

Remove obsolete header, remove debugging code.

* Add code.main option

Add an option to have yalr append the definition of a simple `main()` to
the generated output. See included README or template_genmain.hpp for
details.

* Add error_list class

code improvement #28. Added a class that wraps the list of errors. This
gives a place to hand the list walk and the logic to add with out
duplicating it or leaking the abstration that the list is actually a
std:list.

* Update docs

* Revamp attention pointer in error messages.

Enhancement #24. Underline the offending text. If no text was given
output ~^~ centered at the location.

* Prep docs for next release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant