Static Value-Flow Analysis
Loading...
Searching...
No Matches
CFGNormalizer.h
Go to the documentation of this file.
1//===----- CFGNormalizer.h -- Context Free Grammar Normalizer--------------//
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 * CFGNormalizer.h
25 *
26 * Created on: April 19 , 2022
27 * Author: Pei Xu
28 */
29
30#ifndef INCLUDE_CFL_CFGNORMALIZER_H_
31#define INCLUDE_CFL_CFGNORMALIZER_H_
32
33#include "CFGrammar.h"
34
35namespace SVF
36{
37
81
82} // End namespace SVF
83
84#endif /* INCLUDE_CFL_CFGNORMALIZER_H_*/
void barReplace(CFGrammar *grammar)
void ebnf_bin(CFGrammar *grammar)
Add nonterminal to tranfer long rules to binary rules.
void ebnfSignReplace(char sign, CFGrammar *grammar)
void insertToCFLGrammar(CFGrammar *grammar, GrammarBase::Production &prod)
Based on prod size to add on suitable member field of grammar.
void removeFirstSymbol(CFGrammar *grammar)
CFGrammar * fillAttribute(CFGrammar *grammar, const Map< CFGrammar::Kind, Set< CFGrammar::Attribute > > &kindToAttrsMap)
Expand every variable attribute in rawProductions of grammarbase.
CFGrammar * normalize(GrammarBase *generalGrammar)
Binary Normal Form(BNF) normalization with variable attribute expanded.
int ebnfBracketMatch(GrammarBase::Production &prod, int i, CFGrammar *grammar)
void getFilledProductions(GrammarBase::Production &prod, const NodeSet &nodeSet, CFGrammar *grammar, GrammarBase::Productions &normalProds)
void strTrans(std::string strPro, CFGrammar *grammar, GrammarBase::Production &normalProd)
GrammarBase::Symbol check_head(GrammarBase::SymbolMap< GrammarBase::Symbol, GrammarBase::Productions > &grammar, GrammarBase::Production &rule)
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > SymbolMap
Definition CFGrammar.h:150
SymbolSet< Production > Productions
Definition CFGrammar.h:157
std::vector< Symbol > Production
Definition CFGrammar.h:156
for isBitcode
Definition BasicTypes.h:68
Set< NodeID > NodeSet
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74