-
Notifications
You must be signed in to change notification settings - Fork 2
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.
-
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
- Nonterminal Syntax:
-
Specify language to accept with an AFG
-
Prepare input in a Tokenizer-derived object
- FlexTokenizer is derived from Tokenizer and uses Flex to tokenize input
-
Invoke
parse()
on starting nonterminal