svf-lib 1.0.1007 → 1.0.1010

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -73,6 +73,7 @@ public:
73
73
  graph = cflGraphBuilder.buildBigraph(consCG);
74
74
  cflChecker.check(generalGrammar, graph);
75
75
  grammar = normalizer.normalize(generalGrammar);
76
+ cflChecker.check(grammar, graph);
76
77
  delete consCG;
77
78
  delete generalGrammar;
78
79
  grammar->dump();
@@ -83,6 +84,7 @@ public:
83
84
  graph = cflGraphBuilder.buildFromDot(Options::InputFilename, generalGrammar);
84
85
  cflChecker.check(generalGrammar, graph);
85
86
  grammar = normalizer.normalize(generalGrammar);
87
+ cflChecker.check(grammar, graph);
86
88
  delete generalGrammar;
87
89
  }
88
90
  solver = new CFLSolver(graph, grammar);
@@ -145,21 +145,21 @@ public:
145
145
  return it!=secondRHS2Prods.end();
146
146
  }
147
147
 
148
- const Productions getProdsFromSingleRHS(Symbol sym) const
148
+ const Productions& getProdsFromSingleRHS(Symbol sym) const
149
149
  {
150
150
  auto it = singleRHS2Prods.find(sym);
151
151
  assert(it!=singleRHS2Prods.end() && "production (X -> sym) not found for sym!!");
152
152
  return it->second;
153
153
  }
154
154
 
155
- const Productions getProdsFromFirstRHS(Symbol sym) const
155
+ const Productions& getProdsFromFirstRHS(Symbol sym) const
156
156
  {
157
157
  auto it = firstRHS2Prods.find(sym);
158
158
  assert(it!=firstRHS2Prods.end() && "production (X -> sym Y ) not found for sym!!");
159
159
  return it->second;
160
160
  }
161
161
 
162
- const Productions getProdsFromSecondRHS(Symbol sym) const
162
+ const Productions& getProdsFromSecondRHS(Symbol sym) const
163
163
  {
164
164
  auto it = secondRHS2Prods.find(sym);
165
165
  assert(it!=secondRHS2Prods.end() && "production (X -> Y sym) not found for sym!!");
@@ -167,17 +167,17 @@ public:
167
167
  }
168
168
 
169
169
 
170
- const Symbol getLHSSymbol(const Production& prod)
170
+ const Symbol& getLHSSymbol(const Production& prod)
171
171
  {
172
172
  return prod.at(0);
173
173
  }
174
174
 
175
- const Symbol getFirstRHSSymbol(const Production& prod)
175
+ const Symbol& getFirstRHSSymbol(const Production& prod)
176
176
  {
177
177
  return prod.at(1);
178
178
  }
179
179
 
180
- const Symbol getSecondRHSSymbol(const Production& prod)
180
+ const Symbol& getSecondRHSSymbol(const Production& prod)
181
181
  {
182
182
  return prod.at(2);
183
183
  }
@@ -52,16 +52,16 @@ class GrammarBuilder
52
52
  {
53
53
  private:
54
54
  /// Load whole file content to string
55
- inline std::string loadFileString() const;
55
+ const inline std::string loadFileString() const;
56
56
 
57
57
  /// Parse start symbol and production from file string
58
- inline std::string parseProduction() const;
58
+ const inline std::string parseProduction() const;
59
59
 
60
60
  /// Parse whole production string to production vector
61
- inline std::vector<std::string> loadWordProductions();
61
+ const inline std::vector<std::string> loadWordProductions() const;
62
62
 
63
63
  /// Strip frond and tail space
64
- inline std::string stripSpace(std::string s) const;
64
+ const inline std::string stripSpace(std::string s) const;
65
65
 
66
66
  public:
67
67
  std::string fileName;
@@ -72,9 +72,9 @@ public:
72
72
  grammar = new GrammarBase();
73
73
  };
74
74
 
75
- GrammarBase* build();
75
+ GrammarBase* build() const;
76
76
 
77
- GrammarBase* build(Map<std::string, SVF::CFLGraph::Symbol> &preMap);
77
+ GrammarBase* build(Map<std::string, SVF::CFLGraph::Symbol> &preMap) const;
78
78
  };
79
79
 
80
80
  } // SVF
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1007",
3
+ "version": "1.0.1010",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {