Example #1
0
        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();
        }
Example #2
0
        // TODO:

        internal protected virtual void Walk(SourceUnitTree /*!*/ node)
        {
            if (Enter(node))
            {
                VisitOptionalList(node.Initializers);
                VisitOptionalList(node.Statements);
            }

            Exit(node);
        }
Example #3
0
 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;
 }
Example #4
0
        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);
        }
  }
Example #6
0
 public virtual void Exit(SourceUnitTree/*!*/ node) { }
Example #7
0
 // TODO: generate
 // root:
 public virtual bool Enter(SourceUnitTree/*!*/ node) { return true; }
Example #8
0
 public Transformer(SourceUnitTree AST)
 {
     this.AST = AST;
 }
Example #9
0
 private void DumpRegularExpressions(SourceUnitTree/*!*/ ast) {
     new RegexDumper(_regexLog).Walk(ast);
 }
Example #10
0
 public AstScopeNode(SourceUnitTree ast, ProjectEntry projectEntry)
 {
     _ast = ast;
     _projectEntry = projectEntry;
 }
Example #11
0
 public virtual void Exit(SourceUnitTree /*!*/ node)
 {
 }
Example #12
0
 // TODO: generate
 // root:
 public virtual bool Enter(SourceUnitTree /*!*/ node)
 {
     return(true);
 }
Example #13
0
 public void UpdateTree(SourceUnitTree newAst, IAnalysisCookie newCookie)
 {
     lock (this) {
         _node = newAst;
         _curCookie = newCookie;
     }
     var newParse = OnNewParseTree;
     if (newParse != null) {
         newParse(this, EventArgs.Empty);
     }
 }
Example #14
0
 public void GetTreeAndCookie(out SourceUnitTree tree, out IAnalysisCookie cookie)
 {
     lock (this) {
         tree = _node;
         cookie = _curCookie;
     }
 }