Skip to content

The Attribute Flow Parser Library

Ronald Franco edited this page Dec 26, 2018 · 6 revisions

The Attribute-Flow Parser Library provides a collection of C++11 header files that allows users to easily create general-purpose LL(k) AFParser objects, which make use of a user-specified AFG to accept some LL(k) language. The workflow to create AFParser objects and to prepare and parse some input is given below. The remainder of this wiki section will discuss details about scanning and visualization options available with the AFP Library.

General Usage

  1. Declare (non)terminals

    • Nonterminal Syntax: Parser<InType, OutType> NAME;
    • Terminal Syntax: Parser<InType, OutType> term(token_code);
    • InType and OutType specify the types of the in- and out-flow variable for the (non)terminal
    • token_code is an integer
  2. Specify language to accept with an AFG

  3. Prepare input in a Tokenizer-derived object

    • FlexTokenizer is derived from Tokenizer and uses Flex to tokenize input
  4. Invoke parse() on starting nonterminal

Clone this wiki locally