本文整理汇总了C#中ASTPair类的典型用法代码示例。如果您正苦于以下问题:C# ASTPair类的具体用法?C# ASTPair怎么用?C# ASTPair使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ASTPair类属于命名空间,在下文中一共展示了ASTPair类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: fixed_array_size
public string fixed_array_size() //throws RecognitionException, TokenStreamException
{
string s;
returnAST = null;
ASTPair currentAST = new ASTPair();
AST fixed_array_size_AST = null;
AST bounds_AST = null;
s = string.Empty;
try { // for error handling
AST tmp246_AST = null;
tmp246_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp246_AST);
match(LBRACKET);
{
switch ( LA(1) )
{
case LPAREN:
case SCOPEOP:
case STAR:
case PLUS:
case MINUS:
case TILDE:
case LITERAL_TRUE:
case LITERAL_true:
case LITERAL_FALSE:
case LITERAL_false:
case INT:
case HEX:
case OCTAL:
case LITERAL_L:
case STRING_LITERAL:
case CHAR_LITERAL:
case IDENT:
{
array_bounds();
if (0 == inputState.guessing)
{
bounds_AST = (AST)returnAST;
astFactory.addASTChild(ref currentAST, returnAST);
}
break;
}
case RBRACKET:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
AST tmp247_AST = null;
tmp247_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp247_AST);
match(RBRACKET);
if (0==inputState.guessing)
{
if (bounds_AST != null)
s = bounds_AST.getText();
}
fixed_array_size_AST = currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_39_);
}
else
{
throw ex;
}
}
returnAST = fixed_array_size_AST;
return s;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:82,代码来源:IDLParser.cs
示例2: raises_expr
public void raises_expr() //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST raises_expr_AST = null;
StringCollection ignored = new StringCollection();
try { // for error handling
AST tmp335_AST = null;
tmp335_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp335_AST);
match(LITERAL_raises);
AST tmp336_AST = null;
tmp336_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp336_AST);
match(LPAREN);
scoped_name_list(ignored);
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
AST tmp337_AST = null;
tmp337_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp337_AST);
match(RPAREN);
raises_expr_AST = currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_16_);
}
else
{
throw ex;
}
}
returnAST = raises_expr_AST;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:42,代码来源:IDLParser.cs
示例3: string_literal_list
public void string_literal_list() //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST string_literal_list_AST = null;
try { // for error handling
string_literal();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
{ // ( ... )*
for (;;)
{
if ((LA(1)==COMMA))
{
match(COMMA);
string_literal();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
}
else
{
goto _loop230_breakloop;
}
}
_loop230_breakloop: ;
} // ( ... )*
string_literal_list_AST = currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_14_);
}
else
{
throw ex;
}
}
returnAST = string_literal_list_AST;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:49,代码来源:IDLParser.cs
示例4: param_dcl
public CodeParameterDeclarationExpression param_dcl() //throws RecognitionException, TokenStreamException
{
CodeParameterDeclarationExpression param;
returnAST = null;
ASTPair currentAST = new ASTPair();
AST param_dcl_AST = null;
AST strType_AST = null;
param = new CodeParameterDeclarationExpression();
Hashtable attributes = new Hashtable();
string name = string.Empty;
try { // for error handling
{
switch ( LA(1) )
{
case LBRACKET:
{
AST tmp292_AST = null;
tmp292_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp292_AST);
match(LBRACKET);
param_attributes(attributes);
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
AST tmp293_AST = null;
tmp293_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp293_AST);
match(RBRACKET);
break;
}
case INT3264:
case INT64:
case SCOPEOP:
case LITERAL_const:
case LITERAL_signed:
case LITERAL_unsigned:
case LITERAL_octet:
case LITERAL_any:
case LITERAL_void:
case LITERAL_byte:
case LITERAL_wchar_t:
case LITERAL_handle_t:
case LITERAL_small:
case LITERAL_short:
case LITERAL_long:
case LITERAL_int:
case LITERAL_hyper:
case LITERAL_char:
case LITERAL_float:
case LITERAL_double:
case LITERAL_boolean:
case LITERAL_string:
case LITERAL_SAFEARRAY:
case IDENT:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
{
switch ( LA(1) )
{
case LITERAL_const:
{
AST tmp294_AST = null;
tmp294_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp294_AST);
match(LITERAL_const);
break;
}
case INT3264:
case INT64:
case SCOPEOP:
case LITERAL_signed:
case LITERAL_unsigned:
case LITERAL_octet:
case LITERAL_any:
case LITERAL_void:
case LITERAL_byte:
case LITERAL_wchar_t:
case LITERAL_handle_t:
case LITERAL_small:
case LITERAL_short:
case LITERAL_long:
case LITERAL_int:
case LITERAL_hyper:
case LITERAL_char:
case LITERAL_float:
case LITERAL_double:
case LITERAL_boolean:
case LITERAL_string:
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:WorldPad,代码行数:101,代码来源:IDLParser.cs
示例5: attribute_list
public void attribute_list(
IDictionary attributes
) //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST attribute_list_AST = null;
try { // for error handling
attribute(attributes);
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
{ // ( ... )*
for (;;)
{
if ((LA(1)==COMMA))
{
AST tmp19_AST = null;
tmp19_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp19_AST);
match(COMMA);
attribute(attributes);
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
}
else
{
goto _loop25_breakloop;
}
}
_loop25_breakloop: ;
} // ( ... )*
attribute_list_AST = currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_4_);
}
else
{
throw ex;
}
}
returnAST = attribute_list_AST;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:54,代码来源:IDLParser.cs
示例6: function_attribute_list
public void function_attribute_list(
IDictionary attributes
) //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST function_attribute_list_AST = null;
try { // for error handling
AST tmp276_AST = null;
tmp276_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp276_AST);
match(LBRACKET);
{
switch ( LA(1) )
{
case LITERAL_uuid:
case LITERAL_version:
case LITERAL_async_uuid:
case LITERAL_local:
case LITERAL_object:
case LITERAL_pointer_default:
case LITERAL_endpoint:
case LITERAL_odl:
case LITERAL_optimize:
case LITERAL_proxy:
case LITERAL_aggregatable:
case LITERAL_appobject:
case LITERAL_bindable:
case LITERAL_control:
case LITERAL_custom:
case LITERAL_default:
case LITERAL_defaultbind:
case LITERAL_defaultcollelem:
case LITERAL_defaultvtable:
case LITERAL_displaybind:
case LITERAL_dllname:
case LITERAL_dual:
case LITERAL_entry:
case LITERAL_helpcontext:
case LITERAL_helpfile:
case LITERAL_helpstring:
case LITERAL_helpstringdll:
case LITERAL_hidden:
case LITERAL_id:
case LITERAL_idempotent:
case LITERAL_immediatebind:
case LITERAL_lcid:
case LITERAL_licensed:
case LITERAL_message:
case LITERAL_nonbrowsable:
case LITERAL_noncreatable:
case LITERAL_nonextensible:
case LITERAL_oleautomation:
case LITERAL_restricted:
case LITERAL_context_handle:
case LITERAL_ref:
case LITERAL_unique:
case LITERAL_ptr:
case LITERAL_string:
case LITERAL_callback:
case LITERAL_broadcast:
case LITERAL_ignore:
case LITERAL_propget:
case LITERAL_propput:
case LITERAL_propputref:
case LITERAL_uidefault:
case LITERAL_usesgetlasterror:
case LITERAL_vararg:
{
function_attribute(attributes);
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
{ // ( ... )*
for (;;)
{
if ((LA(1)==COMMA))
{
AST tmp277_AST = null;
tmp277_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp277_AST);
match(COMMA);
function_attribute(attributes);
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
}
else
{
goto _loop203_breakloop;
}
}
_loop203_breakloop: ;
} // ( ... )*
break;
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:WorldPad,代码行数:101,代码来源:IDLParser.cs
示例7: function_attribute
public void function_attribute(
IDictionary attributes
) //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST function_attribute_AST = null;
try { // for error handling
switch ( LA(1) )
{
case LITERAL_callback:
{
AST tmp282_AST = null;
tmp282_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp282_AST);
match(LITERAL_callback);
function_attribute_AST = currentAST.root;
break;
}
case LITERAL_broadcast:
{
AST tmp283_AST = null;
tmp283_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp283_AST);
match(LITERAL_broadcast);
function_attribute_AST = currentAST.root;
break;
}
case LITERAL_ref:
case LITERAL_unique:
case LITERAL_ptr:
{
ptr_attr();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
function_attribute_AST = currentAST.root;
break;
}
case LITERAL_string:
{
string_type();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
function_attribute_AST = currentAST.root;
break;
}
case LITERAL_ignore:
{
AST tmp284_AST = null;
tmp284_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp284_AST);
match(LITERAL_ignore);
function_attribute_AST = currentAST.root;
break;
}
case LITERAL_context_handle:
{
AST tmp285_AST = null;
tmp285_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp285_AST);
match(LITERAL_context_handle);
function_attribute_AST = currentAST.root;
break;
}
case LITERAL_propget:
{
AST tmp286_AST = null;
tmp286_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp286_AST);
match(LITERAL_propget);
if (0==inputState.guessing)
{
attributes.Add("propget", new CodeAttributeArgument());
}
function_attribute_AST = currentAST.root;
break;
}
case LITERAL_propput:
{
AST tmp287_AST = null;
tmp287_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp287_AST);
match(LITERAL_propput);
if (0==inputState.guessing)
{
attributes.Add("propput", new CodeAttributeArgument());
}
function_attribute_AST = currentAST.root;
break;
}
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:WorldPad,代码行数:101,代码来源:IDLParser.cs
示例8: case_label_list
public void case_label_list() //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST case_label_list_AST = null;
try { // for error handling
{ // ( ... )+
int _cnt163=0;
for (;;)
{
if ((LA(1)==LITERAL_default||LA(1)==LITERAL_case))
{
case_label();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
}
else
{
if (_cnt163 >= 1) { goto _loop163_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; }
}
_cnt163++;
}
_loop163_breakloop: ;
} // ( ... )+
case_label_list_AST = currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_3_);
}
else
{
throw ex;
}
}
returnAST = case_label_list_AST;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:45,代码来源:IDLParser.cs
示例9: case_label
public void case_label() //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST case_label_AST = null;
string ignored;
try { // for error handling
switch ( LA(1) )
{
case LITERAL_case:
{
AST tmp260_AST = null;
tmp260_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp260_AST);
match(LITERAL_case);
ignored=const_exp();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
AST tmp261_AST = null;
tmp261_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp261_AST);
match(COLON);
case_label_AST = currentAST.root;
break;
}
case LITERAL_default:
{
AST tmp262_AST = null;
tmp262_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp262_AST);
match(LITERAL_default);
AST tmp263_AST = null;
tmp263_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp263_AST);
match(COLON);
case_label_AST = currentAST.root;
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_45_);
}
else
{
throw ex;
}
}
returnAST = case_label_AST;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:62,代码来源:IDLParser.cs
示例10: n_e_case_stmt
public void n_e_case_stmt() //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST n_e_case_stmt_AST = null;
try { // for error handling
n_e_case_label();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
{
switch ( LA(1) )
{
case INT3264:
case INT64:
case LBRACKET:
case SCOPEOP:
case LITERAL_const:
case LITERAL_signed:
case LITERAL_unsigned:
case LITERAL_octet:
case LITERAL_any:
case LITERAL_void:
case LITERAL_byte:
case LITERAL_wchar_t:
case LITERAL_handle_t:
case LITERAL_small:
case LITERAL_short:
case LITERAL_long:
case LITERAL_int:
case LITERAL_hyper:
case LITERAL_char:
case LITERAL_float:
case LITERAL_double:
case LITERAL_boolean:
case LITERAL_struct:
case LITERAL_union:
case LITERAL_enum:
case LITERAL_sequence:
case LITERAL_string:
case IDENT:
{
unnamed_element_spec();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
break;
}
case SEMI:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
AST tmp252_AST = null;
tmp252_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp252_AST);
match(SEMI);
n_e_case_stmt_AST = currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_42_);
}
else
{
throw ex;
}
}
returnAST = n_e_case_stmt_AST;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:82,代码来源:IDLParser.cs
示例11: case_stmt
public void case_stmt() //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST case_stmt_AST = null;
try { // for error handling
case_label_list();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
unnamed_element_spec();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
AST tmp259_AST = null;
tmp259_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp259_AST);
match(SEMI);
case_stmt_AST = currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_44_);
}
else
{
throw ex;
}
}
returnAST = case_stmt_AST;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:38,代码来源:IDLParser.cs
示例12: n_e_case_list
public void n_e_case_list() //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST n_e_case_list_AST = null;
try { // for error handling
{ // ( ... )+
int _cnt152=0;
for (;;)
{
if ((LA(1)==LBRACKET))
{
n_e_case_stmt();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
}
else
{
if (_cnt152 >= 1) { goto _loop152_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; }
}
_cnt152++;
}
_loop152_breakloop: ;
} // ( ... )+
n_e_case_list_AST = currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_9_);
}
else
{
throw ex;
}
}
returnAST = n_e_case_list_AST;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:45,代码来源:IDLParser.cs
示例13: switch_body
public void switch_body() //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST switch_body_AST = null;
try { // for error handling
case_stmt_list();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
switch_body_AST = currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_9_);
}
else
{
throw ex;
}
}
returnAST = switch_body_AST;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:29,代码来源:IDLParser.cs
示例14: member
public void member(
CodeTypeMemberCollection members
) //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST member_AST = null;
Hashtable attributes = new Hashtable();
CodeTypeMember type;
string name;
try { // for error handling
{
switch ( LA(1) )
{
case LBRACKET:
{
field_attribute_list(attributes);
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
break;
}
case INT3264:
case INT64:
case SCOPEOP:
case LITERAL_const:
case LITERAL_signed:
case LITERAL_unsigned:
case LITERAL_octet:
case LITERAL_any:
case LITERAL_void:
case LITERAL_byte:
case LITERAL_wchar_t:
case LITERAL_handle_t:
case LITERAL_small:
case LITERAL_short:
case LITERAL_long:
case LITERAL_int:
case LITERAL_hyper:
case LITERAL_char:
case LITERAL_float:
case LITERAL_double:
case LITERAL_boolean:
case LITERAL_struct:
case LITERAL_union:
case LITERAL_enum:
case LITERAL_sequence:
case LITERAL_string:
case IDENT:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
type=type_spec();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
name=declarator_list(attributes);
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
AST tmp248_AST = null;
tmp248_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp248_AST);
match(SEMI);
if (0==inputState.guessing)
{
if (type != null && name != string.Empty)
{
if (attributes["IsArray"] != null)
{
List<string> arraySizes = (List<string>)attributes["IsArray"];
if (arraySizes.Count > 1)
{
Console.WriteLine(string.Format("Can't handle multi dimensional arrays: {0}",
name));
}
if (arraySizes.Count == 1)
{
// Add attribute: [MarshalAs(UnmanagedType.ByValArray, SizeConst=x)]
int val;
if (int.TryParse(arraySizes[0], out val))
{
if (type is CodeMemberField)
((CodeMemberField)type).Type.ArrayRank = 1;
else
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:WorldPad,代码行数:101,代码来源:IDLParser.cs
示例15: array_bound
public void array_bound() //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST array_bound_AST = null;
try { // for error handling
positive_int_const();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
array_bound_AST = currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_48_);
}
else
{
throw ex;
}
}
returnAST = array_bound_AST;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:29,代码来源:IDLParser.cs
示例16: element_spec
public void element_spec() //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST element_spec_AST = null;
Hashtable attributes = new Hashtable();
CodeTypeMember type;
string ignored;
try { // for error handling
{
switch ( LA(1) )
{
case LBRACKET:
{
field_attribute_list(attributes);
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
break;
}
case INT3264:
case INT64:
case SCOPEOP:
case LITERAL_const:
case LITERAL_signed:
case LITERAL_unsigned:
case LITERAL_octet:
case LITERAL_any:
case LITERAL_void:
case LITERAL_byte:
case LITERAL_wchar_t:
case LITERAL_handle_t:
case LITERAL_small:
case LITERAL_short:
case LITERAL_long:
case LITERAL_int:
case LITERAL_hyper:
case LITERAL_char:
case LITERAL_float:
case LITERAL_double:
case LITERAL_boolean:
case LITERAL_struct:
case LITERAL_union:
case LITERAL_enum:
case LITERAL_sequence:
case LITERAL_string:
case IDENT:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
type=type_spec();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
ignored=declarator(attributes);
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
element_spec_AST = currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_16_);
}
else
{
throw ex;
}
}
returnAST = element_spec_AST;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:87,代码来源:IDLParser.cs
示例17: param_type_spec
public void param_type_spec() //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST param_type_spec_AST = null;
try { // for error handling
{
switch ( LA(1) )
{
case INT3264:
case INT64:
case LITERAL_signed:
case LITERAL_unsigned:
case LITERAL_octet:
case LITERAL_any:
case LITERAL_void:
case LITERAL_byte:
case LITERAL_wchar_t:
case LITERAL_handle_t:
case LITERAL_small:
case LITERAL_short:
case LITERAL_long:
case LITERAL_int:
case LITERAL_hyper:
case LITERAL_char:
case LITERAL_float:
case LITERAL_double:
case LITERAL_boolean:
{
base_type_spec();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
break;
}
case LITERAL_string:
{
string_type();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
break;
}
case SCOPEOP:
case IDENT:
{
scoped_name();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
{ // ( ... )*
for (;;)
{
if ((LA(1)==STAR))
{
AST tmp272_AST = null;
tmp272_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp272_AST);
match(STAR);
}
else
{
goto _loop235_breakloop;
}
}
_loop235_breakloop: ;
} // ( ... )*
break;
}
case LITERAL_SAFEARRAY:
{
AST tmp273_AST = null;
tmp273_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp273_AST);
match(LITERAL_SAFEARRAY);
AST tmp274_AST = null;
tmp274_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp274_AST);
match(LPAREN);
base_type_spec();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
AST tmp275_AST = null;
tmp275_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp275_AST);
match(RPAREN);
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:WorldPad,代码行数:101,代码来源:IDLParser.cs
示例18: enumerator_list
public void enumerator_list(
string enumName, CodeTypeMemberCollection members
) //throws RecognitionException, TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST enumerator_list_AST = null;
string s1 = string.Empty;
string s2 = string.Empty;
string expr1 = string.Empty;
string expr2 = string.Empty;
try { // for error handling
s1=enumerator(ref expr1);
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
{ // ( ... )*
for (;;)
{
if ((LA(1)==COMMA))
{
AST tmp264_AST = null;
tmp264_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp264_AST);
match(COMMA);
s2=enumerator(ref expr2);
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
if (0==inputState.guessing)
{
members.Add(IDLConversions.CreateEnumMember(enumName, s1, expr1));
s1 = s2;
expr1 = expr2;
}
}
else
{
goto _loop174_breakloop;
}
}
_loop174_breakloop: ;
} // ( ... )*
if (0==inputState.guessing)
{
if (s1 != string.Empty)
members.Add(IDLConversions.CreateEnumMember(enumName, s1, expr1));
}
enumerator_list_AST = currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_9_);
}
else
{
throw ex;
}
}
returnAST = enumerator_list_AST;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:75,代码来源:IDLParser.cs
示例19: parameter_dcls
public CodeParameterDeclarationExpressionCollection parameter_dcls() //throws RecognitionException, TokenStreamException
{
CodeParameterDeclarationExpressionCollection paramColl;
returnAST = null;
ASTPair currentAST = new ASTPair();
AST parameter_dcls_AST = null;
paramColl = new CodeParameterDeclarationExpressionCollection();
CodeParameterDeclarationExpression param;
try { // for error handling
match(LPAREN);
{
switch ( LA(1) )
{
case INT3264:
case INT64:
case LBRACKET:
case SCOPEOP:
case LITERAL_const:
case LITERAL_signed:
case LITERAL_unsigned:
case LITERAL_octet:
case LITERAL_any:
case LITERAL_void:
case LITERAL_byte:
case LITERAL_wchar_t:
case LITERAL_handle_t:
case LITERAL_small:
case LITERAL_short:
case LITERAL_long:
case LITERAL_int:
case LITERAL_hyper:
case LITERAL_char:
case LITERAL_float:
case LITERAL_double:
case LITERAL_boolean:
case LITERAL_string:
case LITERAL_SAFEARRAY:
case IDENT:
{
param=param_dcl();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
if (0==inputState.guessing)
{
paramColl.Add(param);
}
{ // ( ... )*
for (;;)
{
if ((LA(1)==COMMA))
{
match(COMMA);
param=param_dcl();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
if (0==inputState.guessing)
{
paramColl.Add(param);
}
}
else
{
goto _loop208_breakloop;
}
}
_loop208_breakloop: ;
} // ( ... )*
break;
}
case RPAREN:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
match(RPAREN);
parameter_dcls_AST = currentAST.root;
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_51_);
}
else
{
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:WorldPad,代码行数:101,代码来源:IDLParser.cs
示例20: enumerator
public string enumerator(
ref string e
) //throws RecognitionException, TokenStreamException
{
string s;
returnAST = null;
ASTPair currentAST = new ASTPair();
AST enumerator_AST = null;
AST name_AST = null;
s = string.Empty;
e = string.Empty;
try { // for error handling
switch ( LA(1) )
{
case IDENT:
{
identifier();
if (0 == inputState.guessing)
{
name_AST = (AST)returnAST;
astFactory.addASTChild(ref currentAST, returnAST);
}
{
switch ( LA(1) )
{
case ASSIGN:
{
AST tmp265_AST = null;
tmp265_AST = astFactory.create(LT(1));
astFactory.addASTChild(ref currentAST, tmp265_AST);
match(ASSIGN);
e=const_exp();
if (0 == inputState.guessing)
{
astFactory.addASTChild(ref currentAST, returnAST);
}
break;
}
case RBRACE:
case COMMA:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
if (0==inputState.guessing)
{
s = name_AST.getText();
}
enumerator_AST = currentAST.root;
break;
}
case RBRACE:
case COMMA:
{
enumerator_AST = currentAST.root;
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_46_);
}
else
{
throw ex;
}
}
returnAST = enumerator_AST;
return s;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:89,代码来源:IDLParser.cs
注:本文中的ASTPair类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论