public class ParseCpsl extends Object implements JapeConstants, ParseCpslConstants
Modifier and Type | Field and Description |
---|---|
protected URL |
baseURL |
protected SinglePhaseTransducer |
curSPT |
protected String |
encoding |
Token |
jj_nt
Next token.
|
protected Map<String,Object> |
macrosMap
A table of macro definitions.
|
protected Class<? extends SinglePhaseTransducer> |
sptClass |
protected Map<String,Pair> |
templatesMap
A table of template definitions.
|
Token |
token
Current token.
|
ParseCpslTokenManager |
token_source
Generated Token Manager.
|
ALL_STYLE, APPELT_STYLE, BRILL_STYLE, DEFAULT_PRIORITY, FIRST_STYLE, INDENT_PADDING, KLEENE_PLUS, KLEENE_QUERY, KLEENE_STAR, MULTI_SPAN_BINDING, NO_BINDING, NO_KLEENE_OP, ONCE_STYLE, SINGLE_SPAN_BINDING
assign, attrOp, bar, bool, colon, colonplus, comma, commentChars, commentEnd, commentStart, controlleraborted, controllerfinished, controllerstarted, DEFAULT, digits, EOF, exponent, floatingPoint, ident, IN_PHASES, IN_STRING, input, integer, javaimport, kleeneOp, leftBrace, leftBracket, leftSquare, letter, letterOrDigitOrDash, letterOrUnderscore, letters, lettersAndDigits, lettersAndDigitsAndDashes, macro, metaPropOp, multiphase, newline, option, other, path, period, phase, phases, PHASES_WITHIN_COMMENT, phasesCommentChars, phasesCommentEnd, phasesCommentStart, phasesSingleLineCpslStyleComment, phasesSingleLineCStyleComment, phasesWhiteSpace, pling, priority, rightBrace, rightBracket, rightSquare, rule, semicolon, singleLineCpslStyleComment, singleLineCStyleComment, space, spaces, string, template, tokenImage, whiteSpace, WITHIN_COMMENT
Constructor and Description |
---|
ParseCpsl(InputStream stream)
Constructor with InputStream.
|
ParseCpsl(InputStream stream,
String encoding)
Constructor with InputStream and supplied encoding
|
ParseCpsl(ParseCpslTokenManager tm)
Constructor with generated Token Manager.
|
ParseCpsl(Reader stream)
Constructor.
|
ParseCpsl(Reader stream,
Map<String,Object> existingMacros) |
ParseCpsl(Reader stream,
Map<String,Object> existingMacros,
Map<String,Pair> existingTemplates) |
ParseCpsl(URL url,
String encoding)
Construct from a URL and an encoding
|
ParseCpsl(URL url,
String encoding,
Map<String,Object> existingMacros)
Construct from a URL and an encoding
|
ParseCpsl(URL url,
String encoding,
Map<String,Object> existingMacros,
Map<String,Pair> existingTemplates) |
protected Map<String,Pair> templatesMap
protected Class<? extends SinglePhaseTransducer> sptClass
protected SinglePhaseTransducer curSPT
public ParseCpslTokenManager token_source
public ParseCpsl(URL url, String encoding) throws IOException
IOException
public ParseCpsl(URL url, String encoding, Map<String,Object> existingMacros) throws IOException
IOException
public ParseCpsl(URL url, String encoding, Map<String,Object> existingMacros, Map<String,Pair> existingTemplates) throws IOException
IOException
public ParseCpsl(Reader stream, Map<String,Object> existingMacros, Map<String,Pair> existingTemplates)
public ParseCpsl(InputStream stream)
public ParseCpsl(InputStream stream, String encoding)
public ParseCpsl(ParseCpslTokenManager tm)
public void addStatusListener(StatusListener listener)
public void removeStatusListener(StatusListener listener)
protected void fireStatusChangedEvent(String text)
protected SinglePhaseTransducer createSinglePhaseTransducer(String name)
protected ParseCpsl spawn(URL sptURL) throws IOException
IOException
protected void finishSPT(SinglePhaseTransducer t) throws ParseException
ParseException
protected void finishBPE(BasicPatternElement bpe)
public MultiPhaseTransducer MultiPhaseTransducer() throws ParseException
ParseException
protected String toJavaIdentifier(String japeIdentifier)
protected void appendJavaStringLiteral(StringBuffer buf, String str)
str
is null
, we append the four
characters n, u, l, l. Otherwise, we append the contents of str surrounded
by double quotes, except that characters in str are escaped as necessary
to be a legal Java string literal: backspace, formfeed, tab, newline and
return are replaced by their escape sequences \b, \f, etc.; single and double
quote and backslash are preceded by an extra backslash; other non-ASCII
and non-printing characters are rendered as Unicode escapes (backslash-u
followed by four hex digits).protected void appendAnnotationAdd(StringBuffer blockBuffer, String newAnnotType, String annotSetName)
protected Pair substituteTemplate(Token templateNameTok, Map<String,Object> values) throws ParseException
ParseException
public void setBaseURL(URL newURL)
public void setEncoding(String newEncoding)
public void setSptClass(Class<? extends SinglePhaseTransducer> sptClass)
public final MultiPhaseTransducer _MultiPhaseTransducer() throws ParseException
ParseException
public final SinglePhaseTransducer SinglePhaseTransducer(String javaimportblock) throws ParseException
ParseException
public final String JavaImportBlock() throws ParseException
ParseException
public final String ControllerStartedBlock() throws ParseException
ParseException
public final String ControllerFinishedBlock() throws ParseException
ParseException
public final String ControllerAbortedBlock() throws ParseException
ParseException
public final Rule Rule(String phaseName, String currentImports) throws ParseException
ParseException
public final void MacroDef() throws ParseException
ParseException
public final void TemplateDef() throws ParseException
ParseException
public final LeftHandSide LeftHandSide() throws ParseException
ParseException
public final void ConstraintGroup(ConstraintGroup cg) throws ParseException
ParseException
public final PatternElement PatternElement() throws ParseException
ParseException
public final BasicPatternElement BasicPatternElement() throws ParseException
ParseException
public final ComplexPatternElement ComplexPatternElement() throws ParseException
ParseException
public final KleeneOperator KleeneOperator() throws ParseException
ParseException
public final Constraint Constraint() throws ParseException
ParseException
public final AnnotationAccessor FeatureAccessor() throws ParseException
ParseException
public final Pair AttrVal() throws ParseException
ParseException
public final Pair TemplateCall() throws ParseException
ParseException
public final RightHandSide RightHandSide(String phaseName, String ruleName, LeftHandSide lhs, String imports) throws ParseException
ParseException
public final String[] Action(boolean checkLabel) throws ParseException
ParseException
public final String[] NamedJavaBlock(boolean checkLabel) throws ParseException
ParseException
public final String[] AnonymousJavaBlock() throws ParseException
ParseException
public final String[] AssignmentExpression(boolean checkLabel) throws ParseException
ParseException
public void ReInit(InputStream stream)
public void ReInit(InputStream stream, String encoding)
public void ReInit(ParseCpslTokenManager tm)
public final Token getNextToken()
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()