Class SectionParser
java.lang.Object
com.ibm.dtfj.javacore.parser.j9.SectionParserGrammar
com.ibm.dtfj.javacore.parser.j9.SectionParser
- All Implemented Interfaces:
ISectionParser, ICommonTypes
- Direct Known Subclasses:
ClassLoaderSectionParser, EnvironmentSectionParser, MemorySectionParser, MonitorSectionParser, NativeMemorySectionParser, PlatformSectionParser, StackSectionParser, ThreadSectionParser, TitleSectionParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IImageBuilderprotected static final intDepth of at least 3 is needed for J9 javacores, as parsing a section from the start will yield three tokens: SECTION, header information token, first TAG of section (note that NULL lines are ignored by the scanner).Fields declared in class SectionParserGrammar
anyMatched, DEFAULT_DEPTH, fLookAheadBuffer, FORCE_THROW, fSectionName, fTagManager, fTagParserModifier and TypeFieldDescriptionprotected booleanprotected static final intprotected ILookAheadBufferprotected static final intprotected Stringprotected J9TagManagerprotected ITagParserFields declared in interface ICommonTypes
BUILD_INFO, COMMON, JIT_BUILD_VERSION, JIT_PRESENT, JRE_NAME, JRE_VERSION, NULL, POINTER_SIZE, SECTION, UNAVAILABLE_DATA, VM_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAsProperty(Properties properties, String key, String value) voidreadIntoDTFJ(ILookAheadBuffer lookAheadBuffer, IImageBuilder imageBuilder) Pass in a lookahead buffer that is shared amongst all section parsers, pass in the DTFJ factory to construct the DTFJ objects as tags are being parsed.protected abstract voidsovOnlyRules(String startingTag) protected abstract voidMust be implemented by subclass.Methods declared in class SectionParserGrammar
anyMatched, consume, getCurrentFileLineNumber, getErrors, getLineRuleResults, getLookAheadBuffer, getSectionName, handleError, handleError, handleError, handleError, handleError, handleErrorAtLineNumber, handleRequiredMismatch, handleUnknownMismatch, isValidJavaCoreTag, isValidSectionTag, lookAhead, match, matchOptional, matchRequired, processTagLineOptional, processTagLineRequired, setLookAheadBuffer, setLookAheadBuffer, setTagManagerModifier and TypeMethodDescriptionbooleanprotected voidconsume()intReturns the current line number being parsed, or -1 if no parsing is occurring (parsing is finished, etc..).protected IAttributeValueMapgetLineRuleResults(IParserToken token) protected ILookAheadBufferprotected voidprotected voidhandleError(Exception e, int behaviour) protected voidhandleError(String message) protected voidhandleError(String message, int offset, int length) protected voidhandleError(String message, Exception e) protected voidhandleErrorAtLineNumber(int fileLineNumber, String message, Exception e) protected voidhandleRequiredMismatch(String expectedType, String actualType, String actualValue) protected voidhandleUnknownMismatch(String actualType, String actualValue) protected booleanisValidJavaCoreTag(IParserToken token) protected booleanisValidSectionTag(String tag) protected IParserTokenlookAhead(int depth) protected booleanThe match performs one additional function:
if the mismatch is due to an unrecognised javacore tag, that erroneous tag can be interpreted as garbage for now, so the latter is consumed without further processing.protected booleanmatchOptional(String type) Match a type, but do not generate an error if mismatch occurs.protected booleanmatchRequired(String type) Match a type, and generate an error if a mismatch occurs.protected IAttributeValueMapprocessTagLineOptional(String tagName) protected IAttributeValueMapprocessTagLineRequired(String tagName) protected voidsetLookAheadBuffer(ILookAheadBuffer lookAheadBuffer) protected voidsetLookAheadBuffer(ILookAheadBuffer lookAheadBuffer, int depth) protected voidsetTagManager(J9TagManager tagManager)
-
Field Details
-
fImageBuilder
-
LOOKAHEAD_DEPTH
protected static final int LOOKAHEAD_DEPTHDepth of at least 3 is needed for J9 javacores, as parsing a section from the start will yield three tokens: SECTION, header information token, first TAG of section (note that NULL lines are ignored by the scanner). Adjust as necessary for deeper analysis.- See Also:
-
-
Constructor Details
-
SectionParser
-
-
Method Details
-
readIntoDTFJ
public void readIntoDTFJ(ILookAheadBuffer lookAheadBuffer, IImageBuilder imageBuilder) throws ParserException Description copied from interface:ISectionParserPass in a lookahead buffer that is shared amongst all section parsers, pass in the DTFJ factory to construct the DTFJ objects as tags are being parsed.- Specified by:
readIntoDTFJin interfaceISectionParser- Parameters:
lookAheadBuffer-imageBuilder-lookahead- from where to read tokenstag- information containing current tag information at the time of the parse- Throws:
NullPointerException- if a null lookaheadbuffer is passed.ParserException
-
addAsProperty
- Parameters:
properties-key-value-
-
topLevelRule
Must be implemented by subclass.- Parameters:
lookAheadBuffer-- Throws:
ParserException
-
sovOnlyRules
- Parameters:
startingTag-- Throws:
ParserException
-