예제 #1
0
파일: Conv.cs 프로젝트: Wincent01/SharpC
        public override string Deserialize(IList <ScopeVariable> stack, IList <ScopeInstruction> instructions,
                                           MethodBase body)
        {
            var newVar = new ScopeVariable
            {
                Value = stack[stack.Count - 1].Value,
                Type  = CType.ResolveConv(_convCode)
            };

            stack.RemoveAt(stack.Count - 1);
            stack.Add(newVar);
            return("");
        }
예제 #2
0
 private ScopeVariable AddVariable(ScopeVariable scopeVariable)
 {
     variables.Add(scopeVariable.Name, scopeVariable);
     return(scopeVariable);
 }
예제 #3
0
        public MethodEntry DefineMethod(CompileUnitEntry comp_unit, int token,
						 ScopeVariable[] scope_vars, LocalVariableEntry[] locals,
						 LineNumberEntry[] lines, CodeBlockEntry[] code_blocks,
						 string real_name, MethodEntry.Flags flags,
						 int namespace_id)
        {
            if (reader != null)
                throw new InvalidOperationException ();

            MethodEntry method = new MethodEntry (
                this, comp_unit, token, scope_vars, locals, lines, code_blocks,
                real_name, flags, namespace_id);
            AddMethod (method);
            return method;
        }
예제 #4
0
 public ScopeVariable AddReferencedVariable(ScopeVariable baseVariable) =>
 AddVariable(new ReferencedScopeVariable(this, baseVariable));
예제 #5
0
 public ReferencedScopeVariable(Scope scope, ScopeVariable baseVariable)
     : base(scope, baseVariable.Name, baseVariable.Local)
 {
 }