Static Value-Flow Analysis
|
#include <GrammarBuilder.h>
Public Member Functions | |
GrammarBuilder (std::string fileName) | |
GrammarBase * | build () const |
Build grammarBase from fileName. | |
GrammarBase * | build (Map< std::string, SVF::GrammarBase::Symbol > &preMap) const |
Build grammarBase from fileName with preset str2KindMap. | |
Private Member Functions | |
const std::string | parseProductionsString () const |
Parse start symbol and production from file string. | |
const std::vector< std::string > | loadWordProductions () const |
Parse whole production string to production vector. | |
const std::string | stripSpace (std::string s) const |
Strip front and tail space. | |
Private Attributes | |
std::string | fileName |
GrammarBase * | grammar |
Build Grammar from a user specified grammar text
Symbol Format: <kind> [bar] [ _alpha | _number ] kind: any nonspace string start with alphabet, epsilon stand for empty string bar: stand for reverse edge alpha: any single alpha number: any number start with capital: nonterminal start with noncapital: terminal
Production Format: <symbol> -> <symbol> *; LHS and RHS, Separate by '->', symbol separate by ' ', end by ';' support '*', '?', '(', ')'
Input Format: Start: M // Specify Start Symbol in Second Line Terminal: Addr Copy Store Load Gep Vgep // Specify the order of terminal Addr->0, Copy->1 .. Productions: // Each Symbol separate by 'Space', production end with ';' M -> V d; // Terminal in NonCapital M -> dbar V d; // NonTerminal in Capital V -> M abar M a M; // LHS and RHS, Separate by '->' V -> ( M ? abar ) * M ? ( a M ? ) *; // Support '(' ')' '?' '*' four regular expression sign Gep_j -> Gep_i F vgep; // Support variable attribute with variable attribute Gep_1 -> Gep_2; // Support fix number attribute
Definition at line 70 of file GrammarBuilder.h.
|
inline |
Definition at line 86 of file GrammarBuilder.h.
GrammarBase * SVF::GrammarBuilder::build | ( | ) | const |
Build grammarBase from fileName.
Build grammarbase from textfile.
Definition at line 140 of file GrammarBuilder.cpp.
GrammarBase * SVF::GrammarBuilder::build | ( | Map< std::string, SVF::GrammarBase::Symbol > & | preMap | ) | const |
Build grammarBase from fileName with preset str2KindMap.
|
inlineprivate |
Parse whole production string to production vector.
Definition at line 109 of file GrammarBuilder.cpp.
|
inlineprivate |
Parse start symbol and production from file string.
Definition at line 38 of file GrammarBuilder.cpp.
|
inlineprivate |
Strip front and tail space.
Definition at line 125 of file GrammarBuilder.cpp.
|
private |
Definition at line 73 of file GrammarBuilder.h.
|
private |
Definition at line 74 of file GrammarBuilder.h.