本文整理汇总了C#中PascalABCCompiler.SyntaxTree.statement类的典型用法代码示例。如果您正苦于以下问题:C# statement类的具体用法?C# statement怎么用?C# statement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
statement类属于PascalABCCompiler.SyntaxTree命名空间,在下文中一共展示了statement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateWhile
/// <summary>
/// Создать цикл while
/// </summary>
/// <param name="condition">Условие цикла</param>
/// <param name="body">Тело цикла</param>
/// <returns></returns>
public SyntaxTree.while_node CreateWhile(expression condition, statement body)
{
SyntaxTree.while_node res = new SyntaxTree.while_node();
res.CycleType = WhileCycleType.While;
res.expr = condition;
res.statements = body;
return res;
}
示例2: CreateFor
/// <summary>
/// Создать цикл for
/// </summary>
/// <param name="varName">Имя переменной цикла</param>
/// <param name="initValue">Начальное значение переменной цикла</param>
/// <param name="finishValue">Конечное значение переменной цикла</param>
/// <param name="body">Тело цикла</param>
/// <param name="type">Тип цикла(to / downto)</param>
/// <returns></returns>
public SyntaxTree.for_node CreateFor(string varName, expression initValue, expression finishValue, statement body, for_cycle_type type)
{
SyntaxTree.for_node res = new SyntaxTree.for_node();
res.loop_variable = new ident(varName);
res.initial_value = initValue;
res.finish_value = finishValue;
res.statements = body;
res.cycle_type = type;
return res;
}
示例3: write_statement
public void write_statement(statement _statement)
{
write_declaration(_statement);
}
示例4: NewForStmt
public for_node NewForStmt(bool opt_var, ident identifier, type_definition for_stmt_decl_or_assign, expression expr1, for_cycle_type fc_type, expression expr2, token_info opt_tk_do, statement stmt, LexLocation loc)
{
var nfs = new for_node(identifier, expr1, expr2, stmt, fc_type, null, for_stmt_decl_or_assign, opt_var != false, loc);
if (opt_tk_do == null)
{
file_position fp = expr2.source_context.end_position;
syntax_tree_node err_stn = stmt;
if (err_stn == null)
err_stn = expr2;
parsertools.errors.Add(new PABCNETUnexpectedToken(parsertools.CurrentFileName, StringResources.Get("TKDO"), new SourceContext(fp.line_num, fp.column_num + 1, fp.line_num, fp.column_num + 1, 0, 0), err_stn));
}
return nfs;
}
示例5: BuildShortProcFuncDefinitionNoSC
public static procedure_definition BuildShortProcFuncDefinitionNoSC(procedure_header header, statement st)
{
var stlist = new statement_list(st, st.source_context);
var b = new block(null, stlist, st.source_context);
return new procedure_definition(header, b, true, BuildGenSC);
}
示例6: Process
public void Process(statement st)
{
if (st is yield_node)
{
var yn = st as yield_node;
curState += 1;
res.AddMany(
new assign(YieldConsts.Current, yn.ex, yn.source_context),
new assign(YieldConsts.State, curState),
new assign("Result", true),
new procedure_call("exit"),
new labeled_statement(YieldConsts.LabelStatePrefix+curState.ToString())
);
}
else if (st is labeled_statement)
{
var ls = st as labeled_statement;
res.Add(new labeled_statement(ls.label_name));
Process(ls.to_statement);
}
else
{
res.Add(st);
}
}
示例7: with_statement
///<summary>
///Конструктор с параметрами.
///</summary>
public with_statement(statement _what_do,expression_list _do_with)
{
this._what_do=_what_do;
this._do_with=_do_with;
}
示例8: labeled_statement
///<summary>
///Конструктор с параметрами.
///</summary>
public labeled_statement(ident _label_name,statement _to_statement)
{
this._label_name=_label_name;
this._to_statement=_to_statement;
}
示例9: repeat_node
///<summary>
///Конструктор с параметрами.
///</summary>
public repeat_node(statement _statements,expression _expr)
{
this._statements=_statements;
this._expr=_expr;
}
示例10: for_node
///<summary>
///Конструктор с параметрами.
///</summary>
public for_node(ident _loop_variable,expression _initial_value,expression _finish_value,statement _statements,for_cycle_type _cycle_type,expression _increment_value,type_definition _type_name,bool _create_loop_variable,SourceContext sc)
{
this._loop_variable=_loop_variable;
this._initial_value=_initial_value;
this._finish_value=_finish_value;
this._statements=_statements;
this._cycle_type=_cycle_type;
this._increment_value=_increment_value;
this._type_name=_type_name;
this._create_loop_variable=_create_loop_variable;
source_context = sc;
}
示例11: function_lambda_definition
///<summary>
///Конструктор с параметрами.
///</summary>
public function_lambda_definition(ident_list _ident_list,type_definition _return_type,formal_parameters _formal_parameters,statement _proc_body,procedure_definition _proc_definition,expression_list _parameters,string _lambda_name,List<declaration> _defs,LambdaVisitMode _lambda_visit_mode,syntax_tree_node _substituting_node,SourceContext sc)
{
this._ident_list=_ident_list;
this._return_type=_return_type;
this._formal_parameters=_formal_parameters;
this._proc_body=_proc_body;
this._proc_definition=_proc_definition;
this._parameters=_parameters;
this._lambda_name=_lambda_name;
this._defs=_defs;
this._lambda_visit_mode=_lambda_visit_mode;
this._substituting_node=_substituting_node;
source_context = sc;
}
示例12: lock_stmt
///<summary>
///Конструктор с параметрами.
///</summary>
public lock_stmt(expression _lock_object,statement _stmt,SourceContext sc)
{
this._lock_object=_lock_object;
this._stmt=_stmt;
source_context = sc;
}
示例13: switch_stmt
///<summary>
///Конструктор с параметрами.
///</summary>
public switch_stmt(expression _condition,statement _stmt,SwitchPartType _Part,SourceContext sc)
{
this._condition=_condition;
this._stmt=_stmt;
this._Part=_Part;
source_context = sc;
}
示例14: case_node
///<summary>
///Конструктор с параметрами.
///</summary>
public case_node(expression _param,case_variants _conditions,statement _else_statement)
{
this._param=_param;
this._conditions=_conditions;
this._else_statement=_else_statement;
}
示例15: while_node
///<summary>
///Конструктор с параметрами.
///</summary>
public while_node(expression _expr,statement _statements,WhileCycleType _CycleType)
{
this._expr=_expr;
this._statements=_statements;
this._CycleType=_CycleType;
}