Author: sebb Date: Fri Jul 29 17:34:26 2011 New Revision: 1152317 URL: http://svn.apache.org/viewvc?rev=1152317&view=rev Log: Use static access to access static methods
Modified: commons/proper/bcel/trunk/src/examples/Mini/MiniC.java commons/proper/bcel/trunk/src/examples/Mini/MiniParser.java commons/proper/bcel/trunk/src/examples/Mini/MiniParserTokenManager.java Modified: commons/proper/bcel/trunk/src/examples/Mini/MiniC.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/examples/Mini/MiniC.java?rev=1152317&r1=1152316&r2=1152317&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/examples/Mini/MiniC.java (original) +++ commons/proper/bcel/trunk/src/examples/Mini/MiniC.java Fri Jul 29 17:34:26 2011 @@ -67,7 +67,7 @@ public class MiniC implements org.apache if(j == 0) { parser = new MiniParser(new java.io.FileInputStream(file_name[0])); } else { - parser.ReInit(new java.io.FileInputStream(file_name[j])); + MiniParser.ReInit(new java.io.FileInputStream(file_name[j])); } int index = file_name[j].lastIndexOf('.'); @@ -84,8 +84,8 @@ public class MiniC implements org.apache file = file_name[j]; System.out.println("Parsing ..."); - parser.Program(); - ASTProgram program = (ASTProgram)parser.jjtree.rootNode(); + MiniParser.Program(); + ASTProgram program = (ASTProgram)MiniParser.jjtree.rootNode(); System.out.println("Pass 1: Optimizing parse tree ..."); pass = 1; Modified: commons/proper/bcel/trunk/src/examples/Mini/MiniParser.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/examples/Mini/MiniParser.java?rev=1152317&r1=1152316&r2=1152317&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/examples/Mini/MiniParser.java (original) +++ commons/proper/bcel/trunk/src/examples/Mini/MiniParser.java Fri Jul 29 17:34:26 2011 @@ -869,8 +869,8 @@ public class MiniParser/*@bgen(jjtree)*/ } static public void ReInit(java.io.InputStream stream) { - jj_input_stream.ReInit(stream, 1, 1); - token_source.ReInit(jj_input_stream); + ASCII_CharStream.ReInit(stream, 1, 1); + MiniParserTokenManager.ReInit(jj_input_stream); token = new Token(); jj_ntk = -1; jjtree.reset(); @@ -905,8 +905,8 @@ public class MiniParser/*@bgen(jjtree)*/ } static public void ReInit(java.io.Reader stream) { - jj_input_stream.ReInit(stream, 1, 1); - token_source.ReInit(jj_input_stream); + ASCII_CharStream.ReInit(stream, 1, 1); + MiniParserTokenManager.ReInit(jj_input_stream); token = new Token(); jj_ntk = -1; jjtree.reset(); @@ -958,7 +958,7 @@ public class MiniParser/*@bgen(jjtree)*/ if ((oldToken = token).next != null) { token = token.next; } else { - token = token.next = token_source.getNextToken(); + token = token.next = MiniParserTokenManager.getNextToken(); } jj_ntk = -1; if (token.kind == kind) { @@ -986,7 +986,7 @@ public class MiniParser/*@bgen(jjtree)*/ if (jj_scanpos == jj_lastpos) { jj_la--; if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); + jj_lastpos = jj_scanpos = jj_scanpos.next = MiniParserTokenManager.getNextToken(); } else { jj_lastpos = jj_scanpos = jj_scanpos.next; } @@ -1007,7 +1007,7 @@ public class MiniParser/*@bgen(jjtree)*/ if (token.next != null) { token = token.next; } else { - token = token.next = token_source.getNextToken(); + token = token.next = MiniParserTokenManager.getNextToken(); } jj_ntk = -1; jj_gen++; @@ -1020,7 +1020,7 @@ public class MiniParser/*@bgen(jjtree)*/ if (t.next != null) { t = t.next; } else { - t = t.next = token_source.getNextToken(); + t = t.next = MiniParserTokenManager.getNextToken(); } } return t; @@ -1028,7 +1028,7 @@ public class MiniParser/*@bgen(jjtree)*/ static final private int jj_ntk() { if ((jj_nt=token.next) == null) { - return (jj_ntk = (token.next=token_source.getNextToken()).kind); + return (jj_ntk = (token.next=MiniParserTokenManager.getNextToken()).kind); } else { return (jj_ntk = jj_nt.kind); } Modified: commons/proper/bcel/trunk/src/examples/Mini/MiniParserTokenManager.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/examples/Mini/MiniParserTokenManager.java?rev=1152317&r1=1152316&r2=1152317&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/examples/Mini/MiniParserTokenManager.java (original) +++ commons/proper/bcel/trunk/src/examples/Mini/MiniParserTokenManager.java Fri Jul 29 17:34:26 2011 @@ -128,7 +128,7 @@ static private final int jjMoveNfa_1(int if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt))) { return curPos; } - try { curChar = input_stream.readChar(); } + try { curChar = ASCII_CharStream.readChar(); } catch(java.io.IOException e) { return curPos; } } } @@ -194,7 +194,7 @@ static private final int jjStartNfaWithS { jjmatchedKind = kind; jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } + try { curChar = ASCII_CharStream.readChar(); } catch(java.io.IOException e) { return pos + 1; } return jjMoveNfa_0(state, pos + 1); } @@ -255,7 +255,7 @@ static private final int jjMoveStringLit } static private final int jjMoveStringLiteralDfa1_0(long active0) { - try { curChar = input_stream.readChar(); } + try { curChar = ASCII_CharStream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(0, active0); return 1; @@ -318,7 +318,7 @@ static private final int jjMoveStringLit if (((active0 &= old0)) == 0L) { return jjStartNfa_0(0, old0); } - try { curChar = input_stream.readChar(); } + try { curChar = ASCII_CharStream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(1, active0); return 2; @@ -362,7 +362,7 @@ static private final int jjMoveStringLit if (((active0 &= old0)) == 0L) { return jjStartNfa_0(1, old0); } - try { curChar = input_stream.readChar(); } + try { curChar = ASCII_CharStream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(2, active0); return 3; @@ -400,7 +400,7 @@ static private final int jjMoveStringLit if (((active0 &= old0)) == 0L) { return jjStartNfa_0(2, old0); } - try { curChar = input_stream.readChar(); } + try { curChar = ASCII_CharStream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(3, active0); return 4; @@ -549,7 +549,7 @@ static private final int jjMoveNfa_0(int if ((i = jjnewStateCnt) == (startsAt = 6 - (jjnewStateCnt = startsAt))) { return curPos; } - try { curChar = input_stream.readChar(); } + try { curChar = ASCII_CharStream.readChar(); } catch(java.io.IOException e) { return curPos; } } } @@ -636,11 +636,11 @@ static private final Token jjFillToken() Token t = Token.newToken(jjmatchedKind); t.kind = jjmatchedKind; String im = jjstrLiteralImages[jjmatchedKind]; - t.image = (im == null) ? input_stream.GetImage() : im; - t.beginLine = input_stream.getBeginLine(); - t.beginColumn = input_stream.getBeginColumn(); - t.endLine = input_stream.getEndLine(); - t.endColumn = input_stream.getEndColumn(); + t.image = (im == null) ? ASCII_CharStream.GetImage() : im; + t.beginLine = ASCII_CharStream.getBeginLine(); + t.beginColumn = ASCII_CharStream.getBeginColumn(); + t.endLine = ASCII_CharStream.getEndLine(); + t.endColumn = ASCII_CharStream.getEndColumn(); return t; } @@ -662,7 +662,7 @@ public static final Token getNextToken() { try { - curChar = input_stream.BeginToken(); + curChar = ASCII_CharStream.BeginToken(); } catch(java.io.IOException e) { @@ -679,9 +679,9 @@ public static final Token getNextToken() switch(curLexState) { case 0: - try { input_stream.backup(0); + try { ASCII_CharStream.backup(0); while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) { - curChar = input_stream.BeginToken(); + curChar = ASCII_CharStream.BeginToken(); } } catch (java.io.IOException e1) { continue EOFLoop; } @@ -702,7 +702,7 @@ public static final Token getNextToken() if (jjmatchedKind != 0x7fffffff) { if (jjmatchedPos + 1 < curPos) { - input_stream.backup(curPos - jjmatchedPos - 1); + ASCII_CharStream.backup(curPos - jjmatchedPos - 1); } if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { @@ -741,19 +741,19 @@ public static final Token getNextToken() curPos = 0; jjmatchedKind = 0x7fffffff; try { - curChar = input_stream.readChar(); + curChar = ASCII_CharStream.readChar(); continue; } catch (java.io.IOException e1) { } } - int error_line = input_stream.getEndLine(); - int error_column = input_stream.getEndColumn(); + int error_line = ASCII_CharStream.getEndLine(); + int error_column = ASCII_CharStream.getEndColumn(); String error_after = null; boolean EOFSeen = false; - try { input_stream.readChar(); input_stream.backup(1); } + try { ASCII_CharStream.readChar(); ASCII_CharStream.backup(1); } catch (java.io.IOException e1) { EOFSeen = true; - error_after = curPos <= 1 ? "" : input_stream.GetImage(); + error_after = curPos <= 1 ? "" : ASCII_CharStream.GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; @@ -762,8 +762,8 @@ public static final Token getNextToken() } } if (!EOFSeen) { - input_stream.backup(1); - error_after = curPos <= 1 ? "" : input_stream.GetImage(); + ASCII_CharStream.backup(1); + error_after = curPos <= 1 ? "" : ASCII_CharStream.GetImage(); } throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); }