This is an auxiliary library used for other projects related to the course on Static Analysis of Programs and Constraint Solving.
Notice that this is only a parser. It checks whether a given string matches the syntax definition of While. It does not check any other kind of contextual constraint, such as well-typedness, duplicate definitions, definition-before-use, etc.
The complete definition of the syntax can be found in Syntax.md. The corresponding BNF grammar is defined in the parser_erlang.yrl file.
This module can also generate control-flow graphs for a given while program. Note that only basic constructs are allowed (skip
, assignments, conditional statements and while
loops).
If available in Hex, the package can be installed
by adding while_parser
to your list of dependencies in mix.exs
:
def deps do
[
{:while_parser, github: "manuelmontenegro/while_parser"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/while_parser.