use of com.ibm.dtfj.javacore.parser.framework.tag.ILineRule in project openj9 by eclipse.
the class SectionParserGrammar method getLineRuleResults.
/**
* @param type
*
* @throws ParserException
*/
protected IAttributeValueMap getLineRuleResults(IParserToken token) throws ParserException {
IAttributeValueMap results = null;
if (token != null) {
ILineRule lineRule = fTagParser.getLineRule(token.getType());
token = lookAhead(1);
if (token != null && token.getType().equals(IGeneralTokenTypes.UNPARSED_STRING)) {
consume();
if (lineRule != null) {
results = lineRule.parseLine(token.getValue(), token.getLineNumber(), token.getOffset());
}
}
} else {
handleError("Cannot get line rule for a null token.");
}
return results;
}
use of com.ibm.dtfj.javacore.parser.framework.tag.ILineRule in project openj9 by eclipse.
the class EnvironmentTagParser method addProcessIDRule.
/**
* Add rule for the process id (2CIPROCESSID tag)
*/
private void addProcessIDRule() {
ILineRule lineRule = new LineRule() {
public void processLine(String source, int startingOffset) {
// pid is in decimal then hex, we only need the first one.
consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
addToken(PID_STRING, CommonPatternMatchers.dec);
}
};
addTag(T_1CIPROCESSID, lineRule);
}
use of com.ibm.dtfj.javacore.parser.framework.tag.ILineRule in project openj9 by eclipse.
the class EnvironmentTagParser method addEnvironmentVars.
private void addEnvironmentVars() {
ILineRule lineRule = new LineRule() {
public void processLine(String source, int startingOffset) {
consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
addToken(ENV_NAME, NOT_EQUALS);
if (consumeUntilFirstMatch(CommonPatternMatchers.equals)) {
addToken(ENV_VALUE, CommonPatternMatchers.allButLineFeed);
}
}
};
addTag(T_2CIENVVAR, lineRule);
}
use of com.ibm.dtfj.javacore.parser.framework.tag.ILineRule in project openj9 by eclipse.
the class EnvironmentTagParser method addJITModesRule.
/**
* Add rule for the JIT modes (2CICMDLINE tag)
*/
private void addJITModesRule() {
ILineRule lineRule = new LineRule() {
public void processLine(String source, int startingOffset) {
// command line is on a single line, can include whitespace, separators etc
// Java 7.0 - can get [not available]
addToken(JIT_MODE, CommonPatternMatchers.allButLineFeed);
}
};
addTag(T_1CIJITMODES, lineRule);
}
use of com.ibm.dtfj.javacore.parser.framework.tag.ILineRule in project openj9 by eclipse.
the class EnvironmentTagParser method addUserArgs.
/**
* Add rule for an individual user args line (2CIUSERARG tag)
*/
private void addUserArgs() {
final Matcher hexEnd = CommonPatternMatchers.generateMatcher(" 0x\\p{XDigit}+[\\r\\n]*$");
ILineRule lineRule = new LineRule() {
public void processLine(String source, int startingOffset) {
// each user arg setting is on a separate line, comprising a string after
// some whitespace, with optional extra information (hex address) following
consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
if (addAllCharactersAsTokenUntilFirstMatch(ARG_STRING, hexEnd) != null) {
addPrefixedHexToken(ARG_EXTRA);
} else {
addToken(ARG_STRING, CommonPatternMatchers.allButLineFeed);
}
}
};
addTag(T_2CIUSERARG, lineRule);
}
Aggregations