age_parser is powerful toolkit for defining, analyzing and parsing at run-time LALR context-free grammars. The notation used for describing the language grammars is a BNF variant, designed by BINETIX, based on simple Erlang terms, straightforward definitions and standard regular expressions. The code sample below demonstrates how to define in 50 lines the well-known JSON grammar. With age_parser you can create your own run-time language interpreters. For example, we're using this toolkit in our JSON interpreter age_json in order to convert input JSON streams into Erlang maps and vise versa. Three functions are creating the "magic": ✓scan/2 - lexical analyzer (tokenizer) used for preliminary word segmentation and language processing; ✓run/2 - meta-language generator used for describing a readable and optimized functional input required for the language interpretation; ✓run_scan/2 - this function simply combines at run-time the result provided by the tokenizer to the language generator. Some considerations before using this parser: It's quite easy to write here that "you can create your own programming language in a minute", but it shall be an ugly speculation... This documentation is not intended to discuss terms and to cover theoretical cases in the field of programming language interpreters. We're assuming you already have the required background knowledge and understanding. Furthermore, to create and optimize your own language definitions you need to have also some software engineering skills. Perhaps the references below could be useful for you. Anyway, if you already know what you wanna do with this tech - well, be patient, it takes time to achieve something real. |