public void Parse() { var srcunit = HostingHelpers.GetSourceUnit(source); var parser = new IronRuby.Compiler.Parser(errorSink); ast = parser.Parse(srcunit, new RubyCompilerOptions(), errorSink); var transformer = new Transformer.Transformer(ast); transformations = transformer.Transform(); }
// TODO: internal protected virtual void Walk(SourceUnitTree /*!*/ node) { if (Enter(node)) { VisitOptionalList(node.Initializers); VisitOptionalList(node.Statements); } Exit(node); }
public Compiler(SourceUnitTree tree, string source = null) { if (source == null) signature = new string[0]; else { signature = new string[] { "// " + source.MD5(), "// Generated by Fructose on " + DateTime.Now.ToShortDateString() + " by " + Environment.UserName, "//" }; } this.tree = tree; }
public ModelBuilder(SourceUnitTree/*!*/ tree) { _tree = tree; var top = new ModuleEntry("<main>", "<main>", tree, false, false); _outerName = new List<string>(); _outerName.Add(null); _outerModules = new Stack<ModuleEntry>(); _outerModules.Push(top); _outerMethods = new Stack<MethodEntry>(); _definitions = new Dictionary<string, int>(); _entries = new List<ModuleEntry>(); _entries.Add(top); }
private void _1() { // program -> compstmt #line 166 "Parser.y" { _ast = new SourceUnitTree(CurrentScope, GetValue(1).Statements, _initializers, Encoding, _tokenizer.DataOffset); } }
public virtual void Exit(SourceUnitTree/*!*/ node) { }
// TODO: generate // root: public virtual bool Enter(SourceUnitTree/*!*/ node) { return true; }
public Transformer(SourceUnitTree AST) { this.AST = AST; }
private void DumpRegularExpressions(SourceUnitTree/*!*/ ast) { new RegexDumper(_regexLog).Walk(ast); }
public AstScopeNode(SourceUnitTree ast, ProjectEntry projectEntry) { _ast = ast; _projectEntry = projectEntry; }
public virtual void Exit(SourceUnitTree /*!*/ node) { }
// TODO: generate // root: public virtual bool Enter(SourceUnitTree /*!*/ node) { return(true); }
public void UpdateTree(SourceUnitTree newAst, IAnalysisCookie newCookie) { lock (this) { _node = newAst; _curCookie = newCookie; } var newParse = OnNewParseTree; if (newParse != null) { newParse(this, EventArgs.Empty); } }
public void GetTreeAndCookie(out SourceUnitTree tree, out IAnalysisCookie cookie) { lock (this) { tree = _node; cookie = _curCookie; } }