本文整理汇总了C#中Galaxy_Editor_2.Compiler.Generated.node.ALvalueExp.GetLvalue方法的典型用法代码示例。如果您正苦于以下问题:C# ALvalueExp.GetLvalue方法的具体用法?C# ALvalueExp.GetLvalue怎么用?C# ALvalueExp.GetLvalue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Galaxy_Editor_2.Compiler.Generated.node.ALvalueExp
的用法示例。
在下文中一共展示了ALvalueExp.GetLvalue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CaseALvalueExp
public override void CaseALvalueExp(ALvalueExp node)
{
InALvalueExp(node);
if (node.GetLvalue() != null)
{
node.GetLvalue().Apply(this);
}
OutALvalueExp(node);
}
示例2: CaseAAssignmentExp
public override void CaseAAssignmentExp(AAssignmentExp node)
{
ALvalueExp replacer = new ALvalueExp(node.GetLvalue());
data.ExpTypes[replacer] = data.LvalueTypes[replacer.GetLvalue()];
node.ReplaceBy(replacer);
replacer.Apply(this);
}
示例3: MakeAssignmentLeftDynamic
private void MakeAssignmentLeftDynamic(PExp leftSide, PExp rightSide, PType type, AABlock block, ref int index)
{
if (Util.IsBulkCopy(type))
{
if (type is ANamedType)
{
ANamedType aType = (ANamedType)type;
AStructDecl structDecl = data.StructTypeLinks[aType];
foreach (AALocalDecl localDecl in structDecl.GetLocals())
{
ABinopExp newleftSide = new ABinopExp(leftSide, new APlusBinop(new TPlus("+")),
new AStringConstExp(
new TStringLiteral("\"." + localDecl.GetName().Text + "\"")));
ALvalueExp newrightSide =
new ALvalueExp(new AStructLvalue(rightSide, new ADotDotType(new TDot(".")),
new TIdentifier(localDecl.GetName().Text)));
data.ExpTypes[newleftSide] =
data.ExpTypes[newrightSide] =
data.ExpTypes[newleftSide.GetRight()] =
new ANamedType(new TIdentifier("string"), null);
data.ExpTypes[newrightSide] =
data.LvalueTypes[newrightSide.GetLvalue()] = localDecl.GetType();
data.StructFieldLinks[(AStructLvalue) newrightSide.GetLvalue()] = localDecl;
MakeAssignmentLeftDynamic(newleftSide, newrightSide, localDecl.GetType(), block, ref index);
}
}
else
{//Is array type. Can Only be a constant array type
AArrayTempType aType = (AArrayTempType)type;
for (int i = 0; i < int.Parse(aType.GetIntDim().Text); i++)
{
ABinopExp newleftSide = new ABinopExp(leftSide, new APlusBinop(new TPlus("+")),
new AStringConstExp(
new TStringLiteral("\"[" + i + "]\"")));
AArrayLvalue rightLvalue = new AArrayLvalue(new TLBracket("["), rightSide, new AIntConstExp(new TIntegerLiteral(i.ToString())));
ALvalueExp newrightSide = new ALvalueExp(rightLvalue);
data.ExpTypes[newleftSide] =
data.ExpTypes[newrightSide] =
data.ExpTypes[newleftSide.GetRight()] =
new ANamedType(new TIdentifier("string"), null);
data.ExpTypes[newrightSide] = data.LvalueTypes[rightLvalue] = aType.GetType();
data.ExpTypes[rightLvalue.GetIndex()] = new ANamedType(new TIdentifier("int"), null);
MakeAssignmentLeftDynamic(newleftSide, newrightSide, aType.GetType(), block, ref index);
}
}
}
else
{
ANamedType aType = type is APointerType ? new ANamedType(new TIdentifier(Util.IsIntPointer(type, ((APointerType)type).GetType(), data) ? "int" : "string"), null) : (ANamedType)type;
string capitalType = Util.Capitalize(aType.AsIdentifierString());// Char.ToUpper(aType.GetName().Text[0]) + aType.GetName().Text.Substring(1);
leftSide = Util.MakeClone(leftSide, data);
rightSide = Util.MakeClone(rightSide, data);
ABooleanConstExp trueConst1 = new ABooleanConstExp(new ATrueBool());
ABooleanConstExp trueConst2 = new ABooleanConstExp(new ATrueBool());
ASimpleInvokeExp outerInvoke = new ASimpleInvokeExp(new TIdentifier("DataTableSet" + capitalType), new ArrayList() { trueConst2, leftSide, rightSide });
block.GetStatements().Insert(index, new AExpStm(new TSemicolon(";"), outerInvoke));
index++;
data.ExpTypes[trueConst1] =
data.ExpTypes[trueConst2] = new ANamedType(new TIdentifier("bool"), null);
data.ExpTypes[outerInvoke] = new AVoidType(new TVoid("void"));
data.SimpleMethodLinks[outerInvoke] =
data.Libraries.Methods.First(m => m.GetName().Text == outerInvoke.GetName().Text);
}
}
示例4: OutALvalueExp
public override void OutALvalueExp(ALvalueExp node)
{
if (!(node.GetLvalue() is AAmbiguousNameLvalue ||
node.GetLvalue() is ANamespaceLvalue ||
node.GetLvalue() is ATypeLvalue))
if (node.Parent() != null) //If I havent been replaced
data.ExpTypes[node] = data.LvalueTypes[node.GetLvalue()];
base.OutALvalueExp(node);
}
示例5: OutALvalueExp
public override void OutALvalueExp(ALvalueExp node)
{
data.ExpTypes[node] = data.LvalueTypes[node.GetLvalue()];
}