Package org.openjdk.asmtools.jcoder
Class Jcoder
- java.lang.Object
-
- org.openjdk.asmtools.jcoder.Jcoder
-
class Jcoder extends java.lang.ObjectCompiles just 1 source file
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classJcoder.Contextprivate static classJcoder.ContextTagprivate classJcoder.ContextVal
-
Field Summary
Fields Modifier and Type Field Description private ByteBufferbufprivate java.io.DataOutputStreambufstreamprivate java.util.ArrayList<ByteBuffer>Classesprivate Jcoder.Contextcontextprivate intdepthprotected SourceFileenvprivate static charfileSeparatorprotected Scannerscannerprivate java.lang.StringtabStr
-
Constructor Summary
Constructors Constructor Description Jcoder(SourceFile sf, java.util.HashMap<java.lang.String,java.lang.String> macros)Create a parser
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidadjustDepth(boolean up)private voidexpect(JcodTokens.Token t)Expect a token, return its value, scan the next token or throw an exception.private voidparseArray()Parse an array of struct.private voidparseAttr()Parse an Attribute.private voidparseByteArray()Parse a byte array.private voidparseClass(JcodTokens.Token prev)Parse a class or interface declaration.private voidparseClause()private voidparseComp()Parse a Component of JavaCard .cap file.(package private) voidparseFile()Parse an Jcoder file.private voidparseModule()Parse module declarationprivate intparseStruct()Parse a structure.private voidrecoverField()private voidrecoverFile()Recover after a syntax error in the file.voidwrite(java.io.File destdir)Writes the classesvoidwrite(ByteBuffer cls, java.io.File destdir)write to the directory passed with -d option
-
-
-
Field Detail
-
Classes
private java.util.ArrayList<ByteBuffer> Classes
-
buf
private ByteBuffer buf
-
bufstream
private java.io.DataOutputStream bufstream
-
depth
private int depth
-
tabStr
private java.lang.String tabStr
-
context
private Jcoder.Context context
-
env
protected SourceFile env
-
scanner
protected Scanner scanner
-
fileSeparator
private static char fileSeparator
-
-
Constructor Detail
-
Jcoder
Jcoder(SourceFile sf, java.util.HashMap<java.lang.String,java.lang.String> macros) throws java.io.IOException
Create a parser- Throws:
java.io.IOException
-
-
Method Detail
-
expect
private void expect(JcodTokens.Token t) throws SyntaxError, java.io.IOException
Expect a token, return its value, scan the next token or throw an exception.- Throws:
SyntaxErrorjava.io.IOException
-
recoverField
private void recoverField() throws SyntaxError, java.io.IOException- Throws:
SyntaxErrorjava.io.IOException
-
parseArray
private void parseArray() throws java.io.IOExceptionParse an array of struct.- Throws:
java.io.IOException
-
parseByteArray
private void parseByteArray() throws java.io.IOExceptionParse a byte array.- Throws:
java.io.IOException
-
parseAttr
private void parseAttr() throws java.io.IOExceptionParse an Attribute.- Throws:
java.io.IOException
-
parseComp
private void parseComp() throws java.io.IOExceptionParse a Component of JavaCard .cap file.- Throws:
java.io.IOException
-
adjustDepth
private void adjustDepth(boolean up)
-
parseStruct
private int parseStruct() throws java.io.IOExceptionParse a structure.- Throws:
java.io.IOException
-
recoverFile
private void recoverFile() throws java.io.IOExceptionRecover after a syntax error in the file. This involves discarding tokens until an EOF or a possible legal continuation is encountered.- Throws:
java.io.IOException
-
parseModule
private void parseModule() throws java.io.IOExceptionParse module declaration- Throws:
java.io.IOException
-
parseClass
private void parseClass(JcodTokens.Token prev) throws java.io.IOException
Parse a class or interface declaration.- Throws:
java.io.IOException
-
parseClause
private void parseClause() throws java.io.IOException- Throws:
java.io.IOException
-
parseFile
void parseFile()
Parse an Jcoder file.
-
write
public void write(ByteBuffer cls, java.io.File destdir) throws java.io.IOException
write to the directory passed with -d option- Throws:
java.io.IOException
-
write
public void write(java.io.File destdir) throws java.io.IOExceptionWrites the classes- Throws:
java.io.IOException
-
-