public static void assertTrue(boolean condition, String message) { if ( !condition ) { internalError(message); } }
public boolean hasRewrite(int i) { if ( i >= altsWithRewrites.length ) { ErrorManager.internalError("alt "+i+" exceeds number of "+name+ "'s alts ("+altsWithRewrites.length+")"); return false; } return altsWithRewrites[i]; }
public static void assertTrue(boolean condition, String message) { if ( !condition ) { internalError(message); } }
public boolean hasRewrite(int i) { if ( i >= altsWithRewrites.length ) { ErrorManager.internalError("alt "+i+" exceeds number of "+name+ "'s alts ("+altsWithRewrites.length+")"); return false; } return altsWithRewrites[i]; }
public static void assertTrue(boolean condition, String message) { if ( !condition ) { internalError(message); } }
public static void assertTrue(boolean condition, String message) { if ( !condition ) { internalError(message); } }
protected static ReportData decodeReportData(String dataS) { ReportData data = new ReportData(); StringTokenizer st = new StringTokenizer(dataS, "\t"); Field[] fields = ReportData.class.getDeclaredFields(); for (Field f : fields) { String v = st.nextToken(); try { if ( f.getType() == String.class ) { f.set(data, v); } else if ( f.getType() == double.class ) { f.set(data, Double.valueOf(v)); } else { f.set(data, Integer.valueOf(v)); } } catch (Exception e) { ErrorManager.internalError("Can't get data", e); } } return data; }
protected static ReportData decodeReportData(String dataS) { ReportData data = new ReportData(); StringTokenizer st = new StringTokenizer(dataS, "\t"); Field[] fields = ReportData.class.getDeclaredFields(); for (Field f : fields) { String v = st.nextToken(); try { if ( f.getType() == String.class ) { f.set(data, v); } else if ( f.getType() == double.class ) { f.set(data, Double.valueOf(v)); } else { f.set(data, Integer.valueOf(v)); } } catch (Exception e) { ErrorManager.internalError("Can't get data", e); } } return data; }
/** Create a single-line stats report about this grammar suitable to * send to the notify page at antlr.org */ public String toNotifyString() { StringBuilder buf = new StringBuilder(); ReportData data = getReportData(grammar); Field[] fields = ReportData.class.getDeclaredFields(); int i = 0; for (Field f : fields) { try { Object v = f.get(data); String s = v!=null ? v.toString() : "null"; if (i>0) buf.append('\t'); buf.append(s); } catch (Exception e) { ErrorManager.internalError("Can't get data", e); } i++; } return buf.toString(); }
/** Create a single-line stats report about this grammar suitable to * send to the notify page at antlr.org */ public String toNotifyString() { StringBuilder buf = new StringBuilder(); ReportData data = getReportData(grammar); Field[] fields = ReportData.class.getDeclaredFields(); int i = 0; for (Field f : fields) { try { Object v = f.get(data); String s = v!=null ? v.toString() : "null"; if (i>0) buf.append('\t'); buf.append(s); } catch (Exception e) { ErrorManager.internalError("Can't get data", e); } i++; } return buf.toString(); }
/** Create a single-line stats report about this grammar suitable to * send to the notify page at antlr.org */ public String toNotifyString() { StringBuffer buf = new StringBuffer(); ReportData data = getReportData(grammar); Field[] fields = ReportData.class.getDeclaredFields(); int i = 0; for (Field f : fields) { try { Object v = f.get(data); String s = v!=null ? v.toString() : "null"; if (i>0) buf.append('\t'); buf.append(s); } catch (Exception e) { ErrorManager.internalError("Can't get data", e); } i++; } return buf.toString(); }
protected static ReportData decodeReportData(String dataS) { ReportData data = new ReportData(); StringTokenizer st = new StringTokenizer(dataS, "\t"); Field[] fields = ReportData.class.getDeclaredFields(); for (Field f : fields) { String v = st.nextToken(); try { if ( f.getType() == String.class ) { f.set(data, v); } else if ( f.getType() == double.class ) { f.set(data, Double.valueOf(v)); } else { f.set(data, Integer.valueOf(v)); } } catch (Exception e) { ErrorManager.internalError("Can't get data", e); } } return data; }
public void addTransition(Transition e) { if ( e==null ) { throw new IllegalArgumentException("You can't add a null transition"); } if ( numTransitions>transition.length ) { throw new IllegalArgumentException("You can only have "+transition.length+" transitions"); } if ( e!=null ) { transition[numTransitions] = e; numTransitions++; // Set the "back pointer" of the target state so that it // knows about the label of the incoming edge. Label label = e.label; if ( label.isAtom() || label.isSet() ) { if ( ((NFAState)e.target).incidentEdgeLabel!=null ) { ErrorManager.internalError("Clobbered incident edge"); } ((NFAState)e.target).incidentEdgeLabel = e.label; } } }
public void addTransition(Transition e) { if ( e==null ) { throw new IllegalArgumentException("You can't add a null transition"); } if ( numTransitions>transition.length ) { throw new IllegalArgumentException("You can only have "+transition.length+" transitions"); } if ( e!=null ) { transition[numTransitions] = e; numTransitions++; // Set the "back pointer" of the target state so that it // knows about the label of the incoming edge. Label label = e.label; if ( label.isAtom() || label.isSet() ) { if ( ((NFAState)e.target).incidentEdgeLabel!=null ) { ErrorManager.internalError("Clobbered incident edge"); } ((NFAState)e.target).incidentEdgeLabel = e.label; } } }
@Override public void addTransition(Transition e) { if ( e==null ) { throw new IllegalArgumentException("You can't add a null transition"); } if ( numTransitions>transition.length ) { throw new IllegalArgumentException("You can only have "+transition.length+" transitions"); } if ( e!=null ) { transition[numTransitions] = e; numTransitions++; // Set the "back pointer" of the target state so that it // knows about the label of the incoming edge. Label label = e.label; if ( label.isAtom() || label.isSet() ) { if ( ((NFAState)e.target).incidentEdgeLabel!=null ) { ErrorManager.internalError("Clobbered incident edge"); } ((NFAState)e.target).incidentEdgeLabel = e.label; } } }
@Override public void addTransition(Transition e) { if ( e==null ) { throw new IllegalArgumentException("You can't add a null transition"); } if ( numTransitions>transition.length ) { throw new IllegalArgumentException("You can only have "+transition.length+" transitions"); } if ( e!=null ) { transition[numTransitions] = e; numTransitions++; // Set the "back pointer" of the target state so that it // knows about the label of the incoming edge. Label label = e.label; if ( label.isAtom() || label.isSet() ) { if ( ((NFAState)e.target).incidentEdgeLabel!=null ) { ErrorManager.internalError("Clobbered incident edge"); } ((NFAState)e.target).incidentEdgeLabel = e.label; } } }
@Override public void run() { for (int decision=i; decision<=j; decision++) { NFAState decisionStartState = grammar.getDecisionNFAStartState(decision); if ( decisionStartState.getNumberOfTransitions()>1 ) { grammar.createLookaheadDFA(decision,true); } } // now wait for others to finish try { barrier.waitForRelease(); } catch(InterruptedException e) { ErrorManager.internalError("what the hell? DFA interruptus", e); } } }
public void run() { for (int decision=i; decision<=j; decision++) { NFAState decisionStartState = grammar.getDecisionNFAStartState(decision); if ( decisionStartState.getNumberOfTransitions()>1 ) { grammar.createLookaheadDFA(decision,true); } } // now wait for others to finish try { barrier.waitForRelease(); } catch(InterruptedException e) { ErrorManager.internalError("what the hell? DFA interruptus", e); } } }
public void run() { for (int decision=i; decision<=j; decision++) { NFAState decisionStartState = grammar.getDecisionNFAStartState(decision); if ( decisionStartState.getNumberOfTransitions()>1 ) { grammar.createLookaheadDFA(decision,true); } } // now wait for others to finish try { barrier.waitForRelease(); } catch(InterruptedException e) { ErrorManager.internalError("what the hell? DFA interruptus", e); } } }
@Override public void run() { for (int decision=i; decision<=j; decision++) { NFAState decisionStartState = grammar.getDecisionNFAStartState(decision); if ( decisionStartState.getNumberOfTransitions()>1 ) { grammar.createLookaheadDFA(decision,true); } } // now wait for others to finish try { barrier.waitForRelease(); } catch(InterruptedException e) { ErrorManager.internalError("what the hell? DFA interruptus", e); } } }