Ejemplo n.º 1
0
 public bool VisitNode(CompositeSymbolRef node)
 {
     // outersymbol.innersymbol
     node.OuterSymbol.AcceptVisitor(this);
     Append(".");
     node.InnerSymbol.AcceptVisitor(this);
     return(true);
 }
Ejemplo n.º 2
0
        public ReturnStatement DecompileReturn()
        {
            PopByte();

            Expression expr = null;

            if (CurrentIs(OpCodes.ReturnNullValue))
            {
                PopByte();
                var retVal = ReadObject();
                var returnNothingStatement = new ReturnNothingStatement();
                StatementLocations.Add(StartPositions.Pop(), returnNothingStatement);
                return(returnNothingStatement);
            }
            else if (CurrentIs(OpCodes.Nothing))
            {
                PopByte();
            }
            else
            {
                expr = DecompileExpression();
                if (expr == null && PopByte() != (byte)OpCodes.Nothing)
                {
                    return(null); //ERROR ?
                }
            }

            if (ReturnType is Enumeration enm && expr is IntegerLiteral intLit && intLit.Value >= 0 && intLit.Value < enm.Values.Count)
            {
                expr = new CompositeSymbolRef(new SymbolReference(enm, enm.Name), new SymbolReference(null, enm.Values[intLit.Value].Name));
            }
            var statement = new ReturnStatement(expr);

            StatementLocations.Add(StartPositions.Pop(), statement);
            return(statement);
        }
Ejemplo n.º 3
0
 public bool VisitNode(CompositeSymbolRef node)
 {
     throw new NotImplementedException();
 }