public class SyntaxTemplate
extends java.lang.Object
implements java.io.Externalizable
(syntax template)
.Modifier | Constructor and Description |
---|---|
protected |
SyntaxTemplate() |
|
SyntaxTemplate(java.lang.Object template,
SyntaxForm syntax,
Translator tr) |
|
SyntaxTemplate(java.lang.String patternNesting,
java.lang.String template_program,
java.lang.Object[] literal_values,
int max_nesting) |
Modifier and Type | Method and Description |
---|---|
int |
convert_template(java.lang.Object form,
SyntaxForm syntax,
java.lang.StringBuffer template_program,
int nesting,
java.util.Vector literals_vector,
java.lang.Object seen,
boolean isVector,
Translator tr)
Recursively translate a syntax-rule template to a template program.
|
java.lang.Object |
execute(java.lang.Object[] vars,
TemplateScope templateScope)
Expand this template
The compiler translates
(syntax template)
to a call to this method. |
java.lang.Object |
execute(java.lang.Object[] vars,
Translator tr,
TemplateScope templateScope) |
void |
readExternal(java.io.ObjectInput in) |
void |
writeExternal(java.io.ObjectOutput out) |
protected SyntaxTemplate()
public SyntaxTemplate(java.lang.String patternNesting, java.lang.String template_program, java.lang.Object[] literal_values, int max_nesting)
public SyntaxTemplate(java.lang.Object template, SyntaxForm syntax, Translator tr)
public int convert_template(java.lang.Object form, SyntaxForm syntax, java.lang.StringBuffer template_program, int nesting, java.util.Vector literals_vector, java.lang.Object seen, boolean isVector, Translator tr)
form
- the template from the syntax-rulesyntax
- if non-null, the closest surrounding SyntaxForm
template_program
- (output) the translated templatenesting
- the depth of ... we are insideliterals_vector
- (output) the literal data in the templatetr
- the current Translatorpattern_names
)
that is nested at least as much as nesting
;
if there is none such, -1 if there is any pattern variable or elipsis;
and -2 if the is no pattern variable or elipsis.public java.lang.Object execute(java.lang.Object[] vars, TemplateScope templateScope)
(syntax template)
to a call to this method.public java.lang.Object execute(java.lang.Object[] vars, Translator tr, TemplateScope templateScope)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException