Skip to content

ilvivl/TwoSidedContextParser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Two-sided context grammar parser

Information

This program takes a grammar with two-sided contexts and a string of the same alphabet and the generates a derivation tree for it.

The grammar must be written in the extended Backus-Naur notation and match the binary normal form criteria.

The derivation tree generated is in the DOT format, which can be then visualized using GraphViz or this website.

Building

You can build the program with CMake.

boost::program_options is required.

Usage

The string to generate derivation from can be passed via CLI, via stdin or as a file.

Examples:

obparser -g ./tests/an_bn_cn -i aabbcc -o tree.dot
String "aabbcc" will be derived.

obparser aabbcc  -g ./tests/an_bn_cn -o tree.dot
String "aabbcc" will be derived.

obparser -g ./tests/an_bn_cn -f string.txt -o tree.dot
Content of string.txt will be derived.

obparser -g ./tests/an_bn_cn -o tree.dot
> aabbcc
String "aabbcc" will be derived.

Type obparser --help for more info.

About

A parser for two-sided context-free grammars

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 98.5%
  • CMake 1.5%