Advertisement
diegoaguilar

Untitled

Nov 16th, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Grammar () {
  2.  
  3.     this.StartSymbol = undefined;
  4.     this.terminals = [];
  5.     this.nonTerminals = [];
  6.     this.productions = new Object(null);
  7.  
  8.     getProductions = function (productionsArray) {
  9.  
  10.         productions = {}
  11.  
  12.         for (p in productionsArray) {
  13.  
  14.             var production = p.split(/[ ]+->[ ]+/);
  15.             var header = production[0];
  16.             var rules = production[1].split(/[ ]+\|[ ]+/);
  17.  
  18.  
  19.         }
  20.     };
  21. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement