1 package fri.patterns.interpreter.parsergenerator.parsertables; 2 3 import fri.patterns.interpreter.parsergenerator.syntax.Syntax; 4 5 11 12 public class LALRParserTables extends LRParserTables 13 { 14 15 public LALRParserTables(Syntax syntax) 16 throws ParserBuildException 17 { 18 super(syntax); 19 } 20 21 22 protected LRSyntaxNode createStartNode(Nullable nullable, FirstSets firstSets) { 23 return new LALRSyntaxNode(nullable, firstSets); 24 } 25 26 27 28 public static void main(String [] args) { 29 41 String [][] syntax = { 42 { "S", "L", "'='", "R" }, 43 { "S", "R" }, 44 { "L", "'*'", "R" }, 45 { "L", "'id'" }, 46 { "R", "L", }, 47 }; 48 49 try { 50 LALRParserTables p = new LALRParserTables(new Syntax(syntax)); 51 p.dump(System.err); 52 } 53 catch (Exception e) { 54 e.printStackTrace(); 55 } 56 } 57 58 } 59 60 61 148 149 150 151 | Popular Tags |