Esempio n. 1
0
 private CodeParser(ClassDatabase cdtb, FunctionDatabase fdtb, StringDatabase sdtb, IndentationManager indentation, Dictionary<string, LocalVariable> loc)
 {
     this.cdtb = cdtb;
     this.sdtb = sdtb;
     this.fdtb = fdtb;
     indent = indentation;
     locals = loc;
     block = new CodeBlock();
 }
Esempio n. 2
0
        public CodeParser(Databases databases, Function f, IndentationManager lastIndentation)
        {
            fdtb = databases.fdtb;
            cdtb = databases.cdtb;
            sdtb = databases.sdtb;
            indent = lastIndentation;

            int offset = f is LocalFunction ? 1 : 0;

            foreach (Argument a in f.arguments)
            {
                if (!a.isSelfArgument())
                {
                    locals[a.name] = new LocalVariable(locals.Count+offset, a.type);
                }
            }

            if (f is LocalFunction) {
                Argument selfArgument = f.arguments.First((x => x.isSelfArgument()));
                locals[selfArgument.name]=new LocalVariable(0, selfArgument.type);
            }
            #if DEBUG
            Console.WriteLine("Locals are: " + locals.toAdvancedString());
            #endif
            block = new CodeBlock();
        }
Esempio n. 3
0
 public BlockParser(Databases dtbs, IndentationManager manager)
 {
     started = false;
     this.dtbs = dtbs;
     dtb = dtbs.cdtb;
     indent = manager;
 }
Esempio n. 4
0
 public CodeParser(Databases dtbs, IndentationManager oldIndentation)
 {
     fdtb = dtbs.fdtb;
     cdtb = dtbs.cdtb;
     sdtb = dtbs.sdtb;
     indent = oldIndentation;
     block = new CodeBlock();
 }
Esempio n. 5
0
 public DummyParser(IndentationManager oldIndent)
 {
     indent = oldIndent;
 }