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

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

            Exit(node);
        }
Exemple #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;
 }
Exemple #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);
        }
  }
 public virtual void Exit(SourceUnitTree/*!*/ node) { }
 // TODO: generate
 // root:
 public virtual bool Enter(SourceUnitTree/*!*/ node) { return true; }
Exemple #8
0
 public Transformer(SourceUnitTree AST)
 {
     this.AST = AST;
 }
 private void DumpRegularExpressions(SourceUnitTree/*!*/ ast) {
     new RegexDumper(_regexLog).Walk(ast);
 }
Exemple #10
0
 public AstScopeNode(SourceUnitTree ast, ProjectEntry projectEntry)
 {
     _ast = ast;
     _projectEntry = projectEntry;
 }
Exemple #11
0
 public virtual void Exit(SourceUnitTree /*!*/ node)
 {
 }
Exemple #12
0
 // TODO: generate
 // root:
 public virtual bool Enter(SourceUnitTree /*!*/ node)
 {
     return(true);
 }
Exemple #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);
     }
 }
Exemple #14
0
 public void GetTreeAndCookie(out SourceUnitTree tree, out IAnalysisCookie cookie)
 {
     lock (this) {
         tree = _node;
         cookie = _curCookie;
     }
 }