kawa.lang
Class SyntaxTemplate
- Externalizable
public class SyntaxTemplate
extends java.lang.Object
implements Externalizable
The translated form of a (syntax template)
.
int | convert_template(Object form, SyntaxForm syntax, StringBuffer template_program, int nesting, java.util.Vector literals_vector, Object seen, boolean isVector, Translator tr) - Recursively translate a syntax-rule template to a template program.
|
Object | execute(Object[] vars) - Expand this template
The compiler translates
(syntax template)
to a call to this method.
|
Object | execute(Object[] vars, Translator tr)
|
void | readExternal(ObjectInput in)
|
void | writeExternal(ObjectOutput out)
|
SyntaxTemplate
protected SyntaxTemplate()
SyntaxTemplate
public SyntaxTemplate(String patternNesting,
String template_program,
Object[] literal_values,
int max_nesting)
convert_template
public int convert_template(Object form,
SyntaxForm syntax,
StringBuffer template_program,
int nesting,
java.util.Vector literals_vector,
Object seen,
boolean isVector,
Translator tr)
Recursively translate a syntax-rule template to a template program.
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 Translator
- the index of a pattern variable (in
pattern_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.
execute
public Object execute(Object[] vars)
Expand this template
The compiler translates (syntax template)
to a call to this method.
execute
public Object execute(Object[] vars,
Translator tr)
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException