📄 sql92parser.java
字号:
"\021\017\012\020\010\001\001\000\012\014\133\016\021" + "\017\012\020\010\001\001\000\002\001\001\000\002\001" + "\001\000\002\001\001\000\002\001\001\000\002\001\001" + "\000\012\014\140\016\021\017\012\020\010\001\001\000" + "\002\001\001\000\002\001\001\000\006\013\146\015\144" + "\001\001\000\002\001\001\000\002\001\001\000\002\001" + "\001\000\002\001\001\000\006\013\152\015\151\001\001" + "\000\002\001\001\000\002\001\001\000\002\001\001\000" + "\002\001\001\000\002\001\001\000\002\001\001" }); /** Access to <code>reduce_goto</code> table. */ public short[][] reduce_table() {return _reduce_table;} /** Instance of action encapsulation class. */ protected CUP$Sql92Parser$actions action_obj; /** Action encapsulation object initializer. */ protected void init_actions() { action_obj = new CUP$Sql92Parser$actions(this); } /** Invoke a user supplied parse action. */ public java_cup.runtime.Symbol do_action( int act_num, java_cup.runtime.lr_parser parser, java.util.Stack stack, int top) throws java.lang.Exception { /* call code in generated class */ return action_obj.CUP$Sql92Parser$do_action(act_num, parser, stack, top); } /** Indicates start state. */ public int start_state() {return 0;} /** Indicates start production. */ public int start_production() {return 1;} /** <code>EOF</code> Symbol index. */ public int EOF_sym() {return 0;} /** <code>error</code> Symbol index. */ public int error_sym() {return 1;} static Logger log = Logger.getLogger(Sql92Parser.class.getName()); protected final static String ME = "SqlParser"; protected Global global; protected java.util.Map regexMap; /* Constructor used inside xmlBlaster */ public Sql92Parser(Global global, /*java.util.Map regexMap,*/ java_cup.runtime.Scanner s) { this(s); this.global = global; if (log.isLoggable(Level.FINER)) this.log.finer("constructor");// if (regexMap != null) this.regexMap = regexMap;// else this.regexMap = new java.util.HashMap(); } public LikeOpWrapper getExpression(String expression, char escape, boolean simple) { String key = expression; if (escape != (char)0) { key += escape; } LikeOpWrapper wrapper = (LikeOpWrapper)this.regexMap.get(key); if (wrapper == null) { synchronized(this.regexMap) { wrapper = (LikeOpWrapper)this.regexMap.get(key); if (wrapper != null) return wrapper; try { wrapper = new LikeOpWrapper(this.global, expression, escape, simple); this.regexMap.put(key, wrapper); return wrapper; } catch (org.xmlBlaster.util.XmlBlasterException ex) { ex.printStackTrace(); throw new IllegalArgumentException(ex.getMessage()); } } } else return wrapper; } /* Change the method report_error so it will display the line and column of where the error occurred in the input as well as the reason for the error which is passed into the method in the String 'message'. */ public void report_error(String message, Object info) { /* Create a StringBuffer called 'm' with the string 'Error' in it. */ StringBuffer m = new StringBuffer("Error"); /* Check if the information passed to the method is the same type as the type java_cup.runtime.Symbol. */ if (info instanceof java_cup.runtime.Symbol) { /* Declare a java_cup.runtime.Symbol object 's' with the information in the object info that is being typecasted as a java_cup.runtime.Symbol object. */ java_cup.runtime.Symbol s = ((java_cup.runtime.Symbol) info); /* Check if the line number in the input is greater or equal to zero. */ if (s.left >= 0) { /* Add to the end of the StringBuffer error message the line number of the error in the input. */ m.append(" in line "+(s.left+1)); /* Check if the column number in the input is greater or equal to zero. */ if (s.right >= 0) /* Add to the end of the StringBuffer error message the column number of the error in the input. */ m.append(", column "+(s.right+1)); } } /* Add to the end of the StringBuffer error message created in this method the message that was passed into this method. */ m.append(" : "+message); /* Print the contents of the StringBuffer 'm', which contains an error message, out on a line. */ System.err.println(m); } /* Change the method report_fatal_error so when it reports a fatal error it will display the line and column number of where the fatal error occurred in the input as well as the reason for the fatal error which is passed into the method in the object 'message' and then exit. */ public void report_fatal_error(String message, Object info) { report_error(message, info); throw new IllegalArgumentException(message); // System.exit(1); }}/** Cup generated class to encapsulate user supplied action code.*/class CUP$Sql92Parser$actions { private final Sql92Parser parser; /** Constructor */ CUP$Sql92Parser$actions(Sql92Parser parser) { this.parser = parser; } /** Method with the actual generated action code. */ public final java_cup.runtime.Symbol CUP$Sql92Parser$do_action( int CUP$Sql92Parser$act_num, java_cup.runtime.lr_parser CUP$Sql92Parser$parser, java.util.Stack CUP$Sql92Parser$stack, int CUP$Sql92Parser$top) throws java.lang.Exception { /* Symbol object for return from actions */ java_cup.runtime.Symbol CUP$Sql92Parser$result; /* select the action based on the action number */ switch (CUP$Sql92Parser$act_num) { /*. . . . . . . . . . . . . . . . . . . .*/ case 56: // ESC ::= STRING { Character RESULT =null; int pleft = ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()).left; int pright = ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()).right; String p = (String)((java_cup.runtime.Symbol) CUP$Sql92Parser$stack.peek()).value; if (Sql92Parser.log.isLoggable(Level.FINER)) Sql92Parser.log.finer("ESC(STRING) '" + p + "'"); RESULT = new Character(p.charAt(0)); CUP$Sql92Parser$result = parser.getSymbolFactory().newSymbol("ESC",15, ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()), RESULT); } return CUP$Sql92Parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 55: // ESC ::= { Character RESULT =null; CUP$Sql92Parser$result = parser.getSymbolFactory().newSymbol("ESC",15, ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()), RESULT); } return CUP$Sql92Parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 54: // math_pred ::= NULL_OBJECT { Double RESULT =null; int pleft = ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()).left; int pright = ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()).right; Object p = (Object)((java_cup.runtime.Symbol) CUP$Sql92Parser$stack.peek()).value; if (Sql92Parser.log.isLoggable(Level.FINER)) Sql92Parser.log.finer("math_pred(NULL_OBJECT) '" + p + "'"); RESULT = (Double)null; CUP$Sql92Parser$result = parser.getSymbolFactory().newSymbol("math_pred",14, ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()), RESULT); } return CUP$Sql92Parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 53: // math_pred ::= NUMBER { Double RESULT =null; int pleft = ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()).left; int pright = ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()).right; Double p = (Double)((java_cup.runtime.Symbol) CUP$Sql92Parser$stack.peek()).value; if (Sql92Parser.log.isLoggable(Level.FINER)) Sql92Parser.log.finer("math_pred(NUMBER) '" + p + "'"); RESULT = p; CUP$Sql92Parser$result = parser.getSymbolFactory().newSymbol("math_pred",14, ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Sql92Parser$stack.peek()), RESULT); } return CUP$Sql92Parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 52: // math_pred ::= L_BRACKET math_term R_BRACKET
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -