Example #1
0
 private void VisitUnaryOperator(AmlParserNode operand,
                                 AmlParser.Target target, StackIRNode stackNode)
 {
     if (IsNullTarget(target))
     {
         operand.Accept(this);
         result.Add(stackNode);
     }
     else
     {
         target.Accept(this);
         operand.Accept(this);
         result.Add(stackNode);
         result.Add(new Store());
     }
 }
Example #2
0
 private void VisitBinaryOperator(AmlParserNode left, AmlParserNode right,
                                  AmlParser.Target target, StackIRNode stackNode)
 {
     if (IsNullTarget(target))
     {
         right.Accept(this);
         left.Accept(this);
         result.Add(stackNode);
     }
     else
     {
         target.Accept(this);
         right.Accept(this);
         left.Accept(this);
         result.Add(stackNode);
         result.Add(new Store());
     }
 }
Example #3
0
        public bool IsNullTarget(AmlParser.Target target)
        {
            SuperName superName = target.superName;

            if (superName.Tag != SuperName.TagValue.SimpleName)
            {
                return(false);
            }
            SimpleName simpleName = superName.GetAsSimpleName();

            if (simpleName.Tag != SimpleName.TagValue.NameString)
            {
                return(false);
            }
            NodePath nodePath = simpleName.GetAsNameString().nodePath;

            return(!nodePath.IsAbsolute &&
                   nodePath.NumParentPrefixes == 0 &&
                   nodePath.NameSegments.Length == 0);
        }
Example #4
0
 public override void Visit(AmlParser.Target target)
 {
     target.superName.Accept(this);
 }
Example #5
0
 public virtual void Visit(AmlParser.Target target)
 {
     UnhandledNodeType("Target");
 }