antlrjavaparser / antlr-java-parser Goto Github PK
View Code? Open in Web Editor NEWAntlr Java Parser aims to create a Java parser using Antlr 4 grammar rules.
License: GNU Lesser General Public License v3.0
Antlr Java Parser aims to create a Java parser using Antlr 4 grammar rules.
License: GNU Lesser General Public License v3.0
my some java file has unicode variable
that euc-kr encoding and korea language likely "한글변수"
ex
String 한글변수 = "some string";
error
token recognition error at: '한'
token recognition error at: '글'
token recognition error at: '변'
token recognition error at: '수'
Parser fails on following code:
return stepBuilders.get( "step" )
.transactionManager( transactionManager )
.<MyEntity, MyEntity>chunk( 20 )
.reader( reader() )
.processor( loggingProcessor() )
.writer( writer() )
.build();
The problem seems to be with the .<
part.
Cheers
I created simple test with parsing java files. I've cloned netbeans sources and use this code:
import com.github.antlrjavaparser.JavaParser;
import com.github.antlrjavaparser.api.CompilationUnit;
import java.io.File;
public final class TestAntlrParser {
public static void main(String[] args) throws Exception {
parseDirectory(new File("/data/home/hlavki/Download/main-silver"));
}
public static void parseDirectory(File path) {
if (path.isDirectory()) {
File[] files = path.listFiles();
for (File file : files) {
if (!file.getAbsolutePath().contains("/.hg/") && file.getName().endsWith(".java")) {
try {
CompilationUnit cu = JavaParser.parse(file);
if (!cu.getTypes().isEmpty()) {
System.out.println(cu.getPackage().getName() + "." + cu.getTypes().get(0).getName());
}
} catch (Throwable e) {
System.out.println("ERROR: " + e.getMessage());
}
} else if (file.isDirectory()) {
parseDirectory(file);
}
}
}
}
}
And created 3 heap dumps while parsing minute after minute. You can see increasing number of ATNConfig instances.
The statements in the default block of a switch statement disappear. it manifests itself when running with DumpVisitor. I think this is due to the else if statement in SwitchBlockStatementGroupContextAdapter:
else if (context.switchLabel().DEFAULT() != null) {
// Explicitly setting these null for readability
switchEntryStmt.setLabel(null);
switchEntryStmt.setStmts(null);
}
I cloned this repo and flowwed instructions from Readme.md
The step "mvn release:prepare" don't succeed.
Failed tests:
TestAstPosition.ifStatementTest:39 Method body index start is incorrect. expected:<80> but was:<75>
I don't understand, because I don't change the source files.
Not available LICENSE file in source directory structure
Please. Added license and copyright notice.
the fedora pakaging guideline is very strictly precise about this problem
https://fedoraproject.org/wiki/Packaging:LicensingGuidelines?rd=Packaging/LicensingGuidelines#License_Text
thanks
regards
Current version (1.0.15) cannot parse shift operators. Calling JavaParser.parse() will parse the '<<' as '<=' and '>>' as '<'. Besides, it seems that '>>>' cannot be parsed either.
Sample input file:
public class Debug{
public Debug(){
1 << 6; //1 <= 6
1 >> 6; //1 < 6
}
}
Which version of Java does it support? Is it complete? How does it compare to https://github.com/javaparser/javaparser? Are you looking for help for this project?
Thanks!
The transient modifier is being lost when parsing files.
Example:
private transient String myfield;
Becomes:
private String myfield;
Node members beginLine, beginColumn, endLine, endColumn seems to be never set.
Using version 1.0.12 from Maven Central
Example:
public class TrySomeChineseCharacters {
private String test1 = "已删除";
private String test2 = "已发布";
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.