public Grammar Parse(string filename) { this.scanner = new Scanner(filename); this.grammar = new Grammar(); this.Advance(); this.ParseHeader(); this.ParseDeclarations(); this.ParseProductions(); this.ParseEpilog(); return this.grammar; }
public Grammar Parse(string filename) { scanner = new Scanner(filename); grammar = new Grammar(); baseName = System.IO.Path.GetFileNameWithoutExtension(filename); if (GPCG.DEFINES) grammar.TokFName = baseName + ".tokens"; Advance(); ParseHeader(); ParseDeclarations(); ParseProductions(); ParseEpilog(); return grammar; }