kawa.lang

Class SyntaxTemplate

public class SyntaxTemplate extends Object implements Externalizable

The translated form of a (syntax template).
Constructor Summary
protected SyntaxTemplate()
SyntaxTemplate(String patternNesting, String template_program, Object[] literal_values, int max_nesting)
SyntaxTemplate(Object template, SyntaxForm syntax, Translator tr)
Method Summary
intconvert_template(Object form, SyntaxForm syntax, StringBuffer template_program, int nesting, Vector literals_vector, Object seen, boolean isVector, Translator tr)
Recursively translate a syntax-rule template to a template program.
Objectexecute(Object[] vars, TemplateScope templateScope)
Expand this template The compiler translates (syntax template) to a call to this method.
Objectexecute(Object[] vars, Translator tr, TemplateScope templateScope)
voidreadExternal(ObjectInput in)
voidwriteExternal(ObjectOutput out)

Constructor Detail

SyntaxTemplate

protected SyntaxTemplate()

SyntaxTemplate

public SyntaxTemplate(String patternNesting, String template_program, Object[] literal_values, int max_nesting)

SyntaxTemplate

public SyntaxTemplate(Object template, SyntaxForm syntax, Translator tr)

Method Detail

convert_template

public int convert_template(Object form, SyntaxForm syntax, StringBuffer template_program, int nesting, Vector literals_vector, Object seen, boolean isVector, Translator tr)
Recursively translate a syntax-rule template to a template program.

Parameters: form the template from the syntax-rule syntax if non-null, the closest surrounding SyntaxForm template_program (output) the translated template nesting the depth of ... we are inside literals_vector (output) the literal data in the template tr the current Translator

Returns: 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, TemplateScope templateScope)
Expand this template The compiler translates (syntax template) to a call to this method.

execute

public Object execute(Object[] vars, Translator tr, TemplateScope templateScope)

readExternal

public void readExternal(ObjectInput in)

writeExternal

public void writeExternal(ObjectOutput out)

Serial Data: