本文整理汇总了C#中Boo.Lang.Compiler.Ast.MacroStatement.Annotate方法的典型用法代码示例。如果您正苦于以下问题:C# MacroStatement.Annotate方法的具体用法?C# MacroStatement.Annotate怎么用?C# MacroStatement.Annotate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Boo.Lang.Compiler.Ast.MacroStatement
的用法示例。
在下文中一共展示了MacroStatement.Annotate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: macro_stmt
protected MacroStatement macro_stmt() //throws RecognitionException, TokenStreamException
{
MacroStatement returnValue;
returnValue = null;
MacroStatement macro = new MacroStatement();
StatementModifier modifier = null;
antlr.IToken id = null;
try { // for error handling
id=macro_name();
expression_list(macro.Arguments);
{
if ((LA(1)==COLON) && (LA(2)==INDENT||LA(2)==EOL||LA(2)==EOS))
{
{
begin_with_doc(macro);
macro_block(macro.Body.Statements);
end(macro.Body);
if (0==inputState.guessing)
{
macro.Annotate("compound" );
}
}
}
else if ((LA(1)==COLON) && (tokenSet_20_.member(LA(2)))) {
macro_compound_stmt(macro.Body);
if (0==inputState.guessing)
{
macro.Annotate("compound");
}
}
else if ((tokenSet_21_.member(LA(1)))) {
{
{
switch ( LA(1) )
{
case EOL:
case EOS:
{
eos();
break;
}
case IF:
case UNLESS:
case WHILE:
{
modifier=stmt_modifier();
eos();
if (0==inputState.guessing)
{
macro.Modifier = modifier;
}
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
docstring(macro);
}
}
else
{
throw new NoViableAltException(LT(1), getFilename());
}
}
if (0==inputState.guessing)
{
macro.Name = id.getText();
macro.LexicalInfo = ToLexicalInfo(id);
returnValue = macro;
}
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex, "macro_stmt");
recover(ex,tokenSet_22_);
}
else
{
throw ex;
}
}
return returnValue;
}
示例2: macro_stmt
//throws RecognitionException, TokenStreamException
protected MacroStatement macro_stmt()
{
MacroStatement returnValue;
IToken id = null;
returnValue = null;
MacroStatement macro = new MacroStatement();
StatementModifier modifier = null;
try { // for error handling
id = LT(1);
match(ID);
expression_list(macro.Arguments);
{
switch ( LA(1) )
{
case COLON:
{
compound_stmt(macro.Block);
if (0==inputState.guessing)
{
macro.Annotate("compound");
}
break;
}
case EOF:
case EOS:
case NEWLINE:
{
eos();
break;
}
case IF:
case UNLESS:
case WHILE:
{
modifier=stmt_modifier();
eos();
if (0==inputState.guessing)
{
macro.Modifier = modifier;
}
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
if (0==inputState.guessing)
{
macro.Name = id.getText();
macro.LexicalInfo = SourceLocationFactory.ToLexicalInfo(id);
returnValue = macro;
}
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_67_);
}
else
{
throw ex;
}
}
return returnValue;
}