コード例 #1
0
ファイル: TotemAst.cs プロジェクト: Alxandr/IronTotem-3.0
        public TotemAst(bool isModule, ModuleOptions languageFeatures, bool printExpressions, CompilerContext context)
        {
            _isModule = isModule;
            _printExpressions = printExpressions;
            _languageFeatures = languageFeatures;
            _mode = ((TotemCompilerOptions)context.Options).CompilationMode ?? GetCompilationMode(context);
            _compilerContext = context;
            FuncCodeExpr = _functionCode;

            TotemCompilerOptions tco = context.Options as TotemCompilerOptions;
            Debug.Assert(tco != null);

            string name;
            if (!context.SourceUnit.HasPath || (tco.Module & ModuleOptions.ExecOrEvalCode) != 0)
            {
                name = "<module>";
            }
            else
            {
                name = context.SourceUnit.Path;
            }

            _name = name;
            Debug.Assert(_name != null);
            TotemOptions to = ((TotemContext)context.SourceUnit.LanguageContext).TotemOptions;

            _document = context.SourceUnit.Document ?? Expression.SymbolDocument(name, TotemContext.LanguageGuid, TotemContext.VendorGuid);
        }
コード例 #2
0
        public DynamicGetMemberExpression(TotemGetMemberBinder/*!*/ binder, CompilationMode/*!*/ mode, Expression/*!*/ target, Expression codeContext)
        {
            Assert.NotNull(binder, mode, target, codeContext);

            _binder = binder;
            _mode = mode;
            _target = target;
            _codeContext = codeContext;
        }
コード例 #3
0
 public DynamicConvertExpression(TotemConversionBinder binder, CompilationMode mode, Expression target)
 {
     _binder = binder;
     _mode = mode;
     _target = target;
 }
コード例 #4
0
 public TotemDynamicExpressionN(CallSiteBinder binder, CompilationMode mode, IList<Expression> args)
     : base(binder, typeof(object), args)
 {
     _mode = mode;
 }
コード例 #5
0
 public TotemDynamicExpression4(CallSiteBinder binder, CompilationMode mode, Expression arg0, Expression arg1, Expression arg2, Expression arg3)
     : base(binder, arg0, arg1, arg2, arg3)
 {
     _mode = mode;
 }
コード例 #6
0
 public TotemDynamicExpression1(CallSiteBinder binder, CompilationMode mode, Expression arg0)
     : base(binder, arg0)
 {
     _mode = mode;
 }
コード例 #7
0
 public TotemConstantExpression(CompilationMode mode, object value)
 {
     _mode = mode;
     _value = value;
 }
コード例 #8
0
 public TotemDynamicExpression2(CallSiteBinder/*!*/ binder, CompilationMode/*!*/ mode, Expression/*!*/ arg0, Expression/*!*/ arg1)
     : base(binder, arg0, arg1)
 {
     Debug.Assert(mode != null);
     _mode = mode;
 }
コード例 #9
0
ファイル: TotemAst.cs プロジェクト: Alxandr/IronTotem
        /// <summary>
        /// Creates a new  without a body.  ParsingFinished should be called afterwards to set
        /// the body.
        /// </summary>
        public TotemAst(bool isModule, bool printExpressions, CompilerContext context)
        {
            _printExpressions = printExpressions;
            _mode = ((TotemCompilerOptions)context.Options).CompilationMode ?? GetCompilationMode(context);
            _compilerContext = context;
            FuncCodeExpr = _functionCode;

            TotemCompilerOptions tco = context.Options as TotemCompilerOptions;
            Debug.Assert(tco != null);

            string name;
            if (!context.SourceUnit.HasPath)
            {
                name = "<module>";
            }
            else
            {
                name = context.SourceUnit.Path;
            }

            _name = name;
            Debug.Assert(_name != null);
            TotemLanguageOptions po = ((TotemContext)context.SourceUnit.LanguageContext).TotemOptions;

            //            if (po.EnableProfiler
            //#if FEATURE_REFEMIT
            // && _mode != CompilationMode.ToDisk
            //#endif
            //)
            //            {
            //                _profiler = Profiler.GetProfiler(TotemContext);
            //            }

            _document = context.SourceUnit.Document ?? Ast.SymbolDocument(name, TotemContext.LanguageGuid, TotemContext.VendorGuid);
        }