Static Value-Flow Analysis
Loading...
Searching...
No Matches
GrammarBuilder.h
Go to the documentation of this file.
1//===----- GrammarBuilder.h -- CFL Grammar Builder--------------//
2//
3// SVF: Static Value-Flow Analysis
4//
5// Copyright (C) <2013-> <Yulei Sui>
6//
7
8// This program is free software: you can redistribute it and/or modify
9// it under the terms of the GNU Affero General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU Affero General Public License for more details.
17
18// You should have received a copy of the GNU Affero General Public License
19// along with this program. If not, see <http://www.gnu.org/licenses/>.
20//
21//===----------------------------------------------------------------------===//
22
23/*
24 * GrammarBuilder.h
25 *
26 * Created on: April 26, 2022
27 * Author: Pei Xu
28 */
29
30#ifndef INCLUDE_CFL_GRAMMARBUILDER_H_
31#define INCLUDE_CFL_GRAMMARBUILDER_H_
32
33#include "CFL/CFGrammar.h"
34
35namespace SVF
36{
37
71{
72private:
73 std::string fileName;
75
77 const inline std::string parseProductionsString() const;
78
80 const inline std::vector<std::string> loadWordProductions() const;
81
83 const inline std::string stripSpace(std::string s) const;
84
85public:
87 {
88 grammar = new GrammarBase();
89 };
90
92 GrammarBase* build() const;
93
96};
97
98} // SVF
99
100#endif /* INCLUDE_CFL_GRAMMARBUILDER_H_ */
GrammarBase * build() const
Build grammarBase from fileName.
GrammarBase * build(Map< std::string, SVF::GrammarBase::Symbol > &preMap) const
Build grammarBase from fileName with preset str2KindMap.
GrammarBuilder(std::string fileName)
const std::string parseProductionsString() const
Parse start symbol and production from file string.
const std::string stripSpace(std::string s) const
Strip front and tail space.
GrammarBase * grammar
const std::vector< std::string > loadWordProductions() const
Parse whole production string to production vector.
for isBitcode
Definition BasicTypes.h:68
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74