本文整理汇总了C#中ErrorList.ErrorParse方法的典型用法代码示例。如果您正苦于以下问题:C# ErrorList.ErrorParse方法的具体用法?C# ErrorList.ErrorParse怎么用?C# ErrorList.ErrorParse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorList
的用法示例。
在下文中一共展示了ErrorList.ErrorParse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateSet
public ErrorList GenerateSet(Context ctx, Action<Context> exp)
{
Ctx = ctx;
Errors.Clear();
var errors = new ErrorList();
if (T.Type == 0)
{
var error = (CommonErrorNode) T;
errors.ErrorParse(error);
return Errors;
}
var child = (CommonTree) T.Children[0];
switch (child.Type)
{
case 0:
{
var error = (CommonErrorNode) child;
errors.ErrorParse(error);
break;
}
case TemplateLexer.MStart:
case TemplateLexer.EStart:
{
EmitSet(child, exp);
//pop off voidtype from final function in chain
break;
}
default:
{
break;
}
}
return Errors;
}
示例2: EmitArgList
public ErrorList EmitArgList(CommonTree fnArgs, Action<Context> last)
{
var errors = new ErrorList();
if (fnArgs.Type == 0)
{
EmitNullRef();
errors.ErrorParse((CommonErrorNode) fnArgs);
return errors;
}
var args = fnArgs.Children;
var size = args.Count + 1;
var local = Sink.DeclareLocal(typeof (ITemplateType[]));
Sink.FastEmitConstInt(size);
Sink.Emit(OpCodes.Newarr, typeof (ITemplateType));
Sink.FastEmitStoreLocal(local.LocalIndex);
for (var i = 0; i < args.Count; i++)
{
Sink.FastEmitLoadLocal(local.LocalIndex);
Sink.FastEmitConstInt(i);
var exp = new Expression(args[i]);
errors.AddRange(exp.Generate(this));
Sink.Emit(OpCodes.Stelem_Ref);
}
Sink.FastEmitLoadLocal(local.LocalIndex);
Sink.FastEmitConstInt(fnArgs.Children.Count);
last(this);
Sink.Emit(OpCodes.Stelem_Ref);
Sink.FastEmitLoadLocal(local.LocalIndex);
return errors;
}
示例3: OnGenerate
protected override void OnGenerate()
{
var errors = new ErrorList();
if (T.Type == 0)
{
var error = (CommonErrorNode) T;
errors.ErrorParse(error);
Ctx.EmitNullRef();
return;
}
var child = (CommonTree) T.Children[0];
switch (child.Type)
{
case 0:
{
var error = (CommonErrorNode) child;
errors.ErrorParse(error);
Ctx.EmitNullRef();
break;
}
case TemplateLexer.MStart:
case TemplateLexer.EStart:
{
EmitStatement(child);
if (child.Type == TemplateLexer.MStart)
{
EmitDoMacro();
}
break;
}
default:
{
break;
}
}
}