Package org.openjdk.asmtools.jasm
Class ParserCP
- java.lang.Object
-
- org.openjdk.asmtools.jasm.ParseBase
-
- org.openjdk.asmtools.jasm.ParserCP
-
public class ParserCP extends ParseBase
ParserCP ParseCP is a parser class owned by Parser.java. It is primarily responsible for parsing the constant pool and constant declarations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
ParserCP.ParserCPVisitor
ParserCPVisitor This inner class overrides a constant pool visitor to provide specific parsing instructions (per method) for each type of Constant.
-
Field Summary
Fields Modifier and Type Field Description private boolean
exitImmediately
Stop parsing a source file immediately and interpret any issue as an errorprivate int
lbrace
counter of left bracesprivate ParserCP.ParserCPVisitor
pConstVstr
Visitor object
-
Constructor Summary
Constructors Modifier Constructor Description protected
ParserCP(Scanner scanner, Parser parser, Environment env)
main constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkWrongTag(Tables.ConstType tag, Tables.ConstType defaultTag, Tables.ConstType default2Tag)
boolean
isExitImmediately()
protected ConstantPool.ConstCell
parseConstRef(Tables.ConstType defaultTag)
protected ConstantPool.ConstCell
parseConstRef(Tables.ConstType defaultTag, Tables.ConstType default2Tag)
protected ConstantPool.ConstCell
parseConstRef(Tables.ConstType defaultTag, Tables.ConstType default2Tag, boolean ignoreKeywords)
Parse an instruction argument, one of: * #NUMBER, #NAME, [TAG] CONSTVALUEprotected ConstantPool.ConstValue
parseConstValue(Tables.ConstType tag)
Parse CONSTVALUEprotected ConstantPool.ConstValue
parseTagConstValue(Tables.ConstType defaultTag)
Parse [TAG] CONSTVALUEprotected ConstantPool.ConstValue
parseTagConstValue(Tables.ConstType defaultTag, Tables.ConstType default2Tag, boolean ignoreKeywords)
private Tables.ConstType
scanConstByID(boolean ignoreKeywords)
private Tables.ConstType
scanConstPrimVal()
void
setExitImmediately(boolean exitImmediately)
In particular cases it's necessary to interpret a warning issue as an error and stop parsing a source file immediately cpParser.setExitImmediately(true); çparseConstRef(...); cpParser.setExitImmediately(false);-
Methods inherited from class org.openjdk.asmtools.jasm.ParseBase
debugScan, debugStr, enableDebug, init
-
-
-
-
Field Detail
-
exitImmediately
private boolean exitImmediately
Stop parsing a source file immediately and interpret any issue as an error
-
pConstVstr
private ParserCP.ParserCPVisitor pConstVstr
Visitor object
-
lbrace
private int lbrace
counter of left braces
-
-
Constructor Detail
-
ParserCP
protected ParserCP(Scanner scanner, Parser parser, Environment env)
main constructor- Parameters:
scanner
-parser
-env
-
-
-
Method Detail
-
setExitImmediately
public void setExitImmediately(boolean exitImmediately)
In particular cases it's necessary to interpret a warning issue as an error and stop parsing a source file immediately cpParser.setExitImmediately(true); çparseConstRef(...); cpParser.setExitImmediately(false);
-
isExitImmediately
public boolean isExitImmediately()
-
parseConstValue
protected ConstantPool.ConstValue parseConstValue(Tables.ConstType tag) throws java.io.IOException, Scanner.SyntaxError
Parse CONSTVALUE- Throws:
java.io.IOException
Scanner.SyntaxError
-
parseTagConstValue
protected ConstantPool.ConstValue parseTagConstValue(Tables.ConstType defaultTag) throws Scanner.SyntaxError, java.io.IOException
Parse [TAG] CONSTVALUE- Throws:
Scanner.SyntaxError
java.io.IOException
-
scanConstByID
private Tables.ConstType scanConstByID(boolean ignoreKeywords)
-
scanConstPrimVal
private Tables.ConstType scanConstPrimVal() throws Scanner.SyntaxError, java.io.IOException
- Throws:
Scanner.SyntaxError
java.io.IOException
-
checkWrongTag
private void checkWrongTag(Tables.ConstType tag, Tables.ConstType defaultTag, Tables.ConstType default2Tag) throws Scanner.SyntaxError, java.io.IOException
- Throws:
Scanner.SyntaxError
java.io.IOException
-
parseTagConstValue
protected ConstantPool.ConstValue parseTagConstValue(Tables.ConstType defaultTag, Tables.ConstType default2Tag, boolean ignoreKeywords) throws Scanner.SyntaxError, java.io.IOException
- Throws:
Scanner.SyntaxError
java.io.IOException
-
parseConstRef
protected ConstantPool.ConstCell parseConstRef(Tables.ConstType defaultTag) throws Scanner.SyntaxError, java.io.IOException
- Throws:
Scanner.SyntaxError
java.io.IOException
-
parseConstRef
protected ConstantPool.ConstCell parseConstRef(Tables.ConstType defaultTag, Tables.ConstType default2Tag) throws Scanner.SyntaxError, java.io.IOException
- Throws:
Scanner.SyntaxError
java.io.IOException
-
parseConstRef
protected ConstantPool.ConstCell parseConstRef(Tables.ConstType defaultTag, Tables.ConstType default2Tag, boolean ignoreKeywords) throws Scanner.SyntaxError, java.io.IOException
Parse an instruction argument, one of: * #NUMBER, #NAME, [TAG] CONSTVALUE- Throws:
Scanner.SyntaxError
java.io.IOException
-
-