6

How to create a parser in erlang that will take in a properly formed propositional formula and converts it into some internal representation.

Listing the available tools for creating a parser in erlang and also projects that uses them can be helpful.

3
  • To answer your question need to know the more details. Commented Jan 5, 2016 at 18:38
  • 2
    Look up the documentation for leex and yecc. Commented Jan 5, 2016 at 18:40
  • Here's how to build your own parser for expressions, without any use of parser generator tools: stackoverflow.com/questions/2245962/… Commented Jan 27, 2016 at 3:22

1 Answer 1

8

You can use leex, yecc, spell1 and some others.

  • leex: A regular expression based lexical analyzer generator for Erlang, similar to lex or flex. A lexer file includes parts for Definition, Rules and also Erlang codes.

  • yecc: An LALR-1 parser generator for Erlang, similar to yacc. A parser generator file includes parts for Non-terminals, Terminals, Rules and Root-symbols.

  • spell1: An LL(1) parser generator for Erlang and LFE which is a Lisp dialect language on top of Erlang.

  • neotoma: A packrat parser-generator for Erlang for Parsing Expression Grammars (PEGs).


Some open source projects that uses them:

  • Efene: Alternative syntax for the Erlang Programming Language focusing on simplicity, ease of use. It uses leex and yecc for parsing the language syntax of Efene.
  • ErlyDTL: Django templates for Erlang which uses leex and yecc to parse Django based template language.
  • Tnesia: A time-series database which has a SQL-like language (TQL) which implemented with leex and yecc.

This Slide includes some useful examples about how to use them.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.