Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
matozoid committed Oct 30, 2011
1 parent 9eef622 commit 6f070b8
Show file tree
Hide file tree
Showing 12 changed files with 11,732 additions and 13,439 deletions.
17,456 changes: 7,635 additions & 9,821 deletions src/main/java/japa/parser/ASTParser.java

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions src/main/java/japa/parser/ASTParserConstants.java
@@ -1,26 +1,26 @@
/* Generated By:JavaCC: Do not edit this line. ASTParserConstants.java */
/*
* Copyright (C) 2008 Júlio Vilmar Gesser.
*
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
*
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
/*
* Copyright (C) 2008 Júlio Vilmar Gesser.
*
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
*
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
*/
package japa.parser;


/**
/**
* Token literal values and constants.
* Generated by org.javacc.parser.OtherFilesGen#start()
*/
Expand Down
105 changes: 31 additions & 74 deletions src/main/java/japa/parser/ASTParserTokenManager.java
@@ -1,21 +1,21 @@
/* Generated By:JavaCC: Do not edit this line. ASTParserTokenManager.java */
/*
* Copyright (C) 2008 Júlio Vilmar Gesser.
*
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
*
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
/*
* Copyright (C) 2008 Júlio Vilmar Gesser.
*
* This file is part of Java 1.5 parser and Abstract Syntax Tree.
*
* Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
*/
package japa.parser;
import java.io.*;
Expand All @@ -29,47 +29,6 @@
/** Token Manager. */
public class ASTParserTokenManager implements ASTParserConstants
{
private List<Comment> comments;
private final Stack<JavadocComment> javadocStack = new Stack<JavadocComment>();
private JavadocComment lastJavadoc;

void pushJavadoc() {
javadocStack.push(lastJavadoc);
}

JavadocComment popJavadoc() {
return javadocStack.pop();
}

List<Comment> getComments() {
return comments;
}

void clearComments() {
comments = null;
javadocStack.clear();
lastJavadoc = null;
}

private void CommonTokenAction(Token token) {
lastJavadoc = null;
if (token.specialToken != null) {
if(comments == null) {
comments = new LinkedList<Comment>();
}
Token special = token.specialToken;
if(special.kind == JAVA_DOC_COMMENT) {
lastJavadoc = new JavadocComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(3, special.image.length()-2));
comments.add(lastJavadoc);
} else if(special.kind == SINGLE_LINE_COMMENT) {
LineComment comment = new LineComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2));
comments.add(comment);
} else if(special.kind == MULTI_LINE_COMMENT) {
BlockComment comment = new BlockComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2, special.image.length()-2));
comments.add(comment);
}
}
}

/** Debug output. */
public java.io.PrintStream debugStream = System.out;
Expand Down Expand Up @@ -1792,7 +1751,7 @@ private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, lo
{
case 0:
return ((jjbitVec2[i2] & l2) != 0L);
default :
default :
if ((jjbitVec0[i1] & l1) != 0L)
return true;
return false;
Expand Down Expand Up @@ -1882,7 +1841,7 @@ private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, lo
return ((jjbitVec41[i2] & l2) != 0L);
case 255:
return ((jjbitVec42[i2] & l2) != 0L);
default :
default :
if ((jjbitVec3[i1] & l1) != 0L)
return true;
return false;
Expand Down Expand Up @@ -1976,7 +1935,7 @@ private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, lo
return ((jjbitVec67[i2] & l2) != 0L);
case 255:
return ((jjbitVec68[i2] & l2) != 0L);
default :
default :
if ((jjbitVec3[i1] & l1) != 0L)
return true;
return false;
Expand Down Expand Up @@ -2011,9 +1970,9 @@ private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, lo

/** Lexer state names. */
public static final String[] lexStateNames = {
"DEFAULT",
"IN_JAVA_DOC_COMMENT",
"IN_MULTI_LINE_COMMENT",
"DEFAULT",
"IN_JAVA_DOC_COMMENT",
"IN_MULTI_LINE_COMMENT",
};

/** Lex State array. */
Expand Down Expand Up @@ -2130,17 +2089,16 @@ public Token getNextToken()

EOFLoop :
for (;;)
{
try
{
{
try
{
curChar = input_stream.BeginToken();
}
}
catch(java.io.IOException e)
{
{
jjmatchedKind = 0;
matchedToken = jjFillToken();
matchedToken.specialToken = specialToken;
CommonTokenAction(matchedToken);
return matchedToken;
}
image = jjimage;
Expand Down Expand Up @@ -2191,7 +2149,6 @@ public Token getNextToken()
TokenLexicalActions(matchedToken);
if (jjnewLexState[jjmatchedKind] != -1)
curLexState = jjnewLexState[jjmatchedKind];
CommonTokenAction(matchedToken);
return matchedToken;
}
else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
Expand All @@ -2208,7 +2165,7 @@ else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
}
SkipLexicalActions(matchedToken);
}
else
else
SkipLexicalActions(null);
if (jjnewLexState[jjmatchedKind] != -1)
curLexState = jjnewLexState[jjmatchedKind];
Expand Down Expand Up @@ -2267,7 +2224,7 @@ void MoreLexicalActions()
jjimageLen = 0;
input_stream.backup(1);
break;
default :
default :
break;
}
}
Expand All @@ -2289,7 +2246,7 @@ void TokenLexicalActions(Token matchedToken)
((ASTParser.GTToken)matchedToken).realKind = RSIGNEDSHIFT;
input_stream.backup(1);
break;
default :
default :
break;
}
}
Expand Down

0 comments on commit 6f070b8

Please sign in to comment.