Package org.openjdk.asmtools.jcoder
Class Jcoder
- java.lang.Object
-
- org.openjdk.asmtools.jcoder.Jcoder
-
class Jcoder extends java.lang.Object
Compiles just 1 source file
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
Jcoder.Context
private static class
Jcoder.ContextTag
private class
Jcoder.ContextVal
-
Field Summary
Fields Modifier and Type Field Description private ByteBuffer
buf
private java.io.DataOutputStream
bufstream
private java.util.ArrayList<ByteBuffer>
Classes
private Jcoder.Context
context
private int
depth
protected SourceFile
env
private static char
fileSeparator
protected Scanner
scanner
private java.lang.String
tabStr
-
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 void
adjustDepth(boolean up)
private void
expect(JcodTokens.Token t)
Expect a token, return its value, scan the next token or throw an exception.private void
parseArray()
Parse an array of struct.private void
parseAttr()
Parse an Attribute.private void
parseByteArray()
Parse a byte array.private void
parseClass(JcodTokens.Token prev)
Parse a class or interface declaration.private void
parseClause()
private void
parseComp()
Parse a Component of JavaCard .cap file.(package private) void
parseFile()
Parse an Jcoder file.private void
parseModule()
Parse module declarationprivate int
parseStruct()
Parse a structure.private void
recoverField()
private void
recoverFile()
Recover after a syntax error in the file.void
write(java.io.File destdir)
Writes the classesvoid
write(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:
SyntaxError
java.io.IOException
-
recoverField
private void recoverField() throws SyntaxError, java.io.IOException
- Throws:
SyntaxError
java.io.IOException
-
parseArray
private void parseArray() throws java.io.IOException
Parse an array of struct.- Throws:
java.io.IOException
-
parseByteArray
private void parseByteArray() throws java.io.IOException
Parse a byte array.- Throws:
java.io.IOException
-
parseAttr
private void parseAttr() throws java.io.IOException
Parse an Attribute.- Throws:
java.io.IOException
-
parseComp
private void parseComp() throws java.io.IOException
Parse a Component of JavaCard .cap file.- Throws:
java.io.IOException
-
adjustDepth
private void adjustDepth(boolean up)
-
parseStruct
private int parseStruct() throws java.io.IOException
Parse a structure.- Throws:
java.io.IOException
-
recoverFile
private void recoverFile() throws java.io.IOException
Recover 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.IOException
Parse 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.IOException
Writes the classes- Throws:
java.io.IOException
-
-