org.antlr.codegen.templates.Ruby.ST.stg Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of antlr-complete Show documentation
Show all versions of antlr-complete Show documentation
Complete distribution for ANTLR 3
@parserBody.mixins() ::= <<
<@super.mixins()>
include ANTLR3::Template::RewriteBuilder
include ANTLR3::Template::Builder
>>
gatedAction( block ) ::= <<
if
end
>>
/** x+=rule when output=template */
ruleRefAndListLabel(rule,label,elementIndex,args,scope) ::= <<
.template}, ...)>
>>
rewriteTemplate(alts) ::= <<
}; anchor, separator="\n\n">
})>
>>
rewriteTemplateAltFirst(a) ::= <<
if
#
return_value.template =
#
return_value.template =
>>
rewriteTemplateAltRest(a) ::= <<
if
#
return_value.template =
e
#
return_value.template =
end
>>
replaceTextInLine() ::= <<
@input.token_stream.replace(
@input.adaptor.token_start_index( return_value.start ),
@input.adaptor.token_stop_index( return_value.start ),
return_value.template
)
@input.replace(
return_value.start.index,
@input.look( -1 ).index,
return_value.template
)
>>
rewriteEmptyTemplate(alts) ::= <<
nil
>>
/** Invoke a template with a set of attribute name/value pairs.
* Set the value of the rule's template *after* having set
* the attributes because the rule's template might be used as
* an attribute to build a bigger template; you get a self-embedded
* template.
*/
rewriteExternalTemplate(name,args) ::= <<
fetch_template( "" ,
)
>>
/** expr is a string expression that says what template to load */
rewriteIndirectTemplate(expr,args) ::= <<
fetch_template( , )
>>
/** Invoke an inline template with a set of attribute name/value pairs */
rewriteInlineTemplate(args, template) ::= <<
create_template( "", )
>>
/** plain -> {foo} action */
rewriteAction(action) ::= <<
>>
/** An action has %st.attrName=expr; or %{st}.attrName=expr; */
actionSetAttribute(st,attrName,expr) ::= <<
( )[ : ] =
>>
/** Translate %{stringExpr} */
actionStringConstructor(stringExpr) ::= <<
create_template( )
>>
/*
rulePropertyRef_text(scope, attr) ::= <<
@input.to_s(return_value.start, @input.look(-1))
>>
*/
argumentMap(args) ::= <<
=> }; separator=",\n">
>>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy