Exemplo n.º 1
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);
        }
        public DynamicGetMemberExpression(TotemGetMemberBinder/*!*/ binder, CompilationMode/*!*/ mode, Expression/*!*/ target, Expression codeContext)
        {
            Assert.NotNull(binder, mode, target, codeContext);

            _binder = binder;
            _mode = mode;
            _target = target;
            _codeContext = codeContext;
        }
Exemplo n.º 3
0
 public DynamicConvertExpression(TotemConversionBinder binder, CompilationMode mode, Expression target)
 {
     _binder = binder;
     _mode = mode;
     _target = target;
 }
Exemplo n.º 4
0
 public TotemDynamicExpressionN(CallSiteBinder binder, CompilationMode mode, IList<Expression> args)
     : base(binder, typeof(object), args)
 {
     _mode = mode;
 }
Exemplo n.º 5
0
 public TotemDynamicExpression4(CallSiteBinder binder, CompilationMode mode, Expression arg0, Expression arg1, Expression arg2, Expression arg3)
     : base(binder, arg0, arg1, arg2, arg3)
 {
     _mode = mode;
 }
Exemplo n.º 6
0
 public TotemDynamicExpression1(CallSiteBinder binder, CompilationMode mode, Expression arg0)
     : base(binder, arg0)
 {
     _mode = mode;
 }
Exemplo n.º 7
0
 public TotemConstantExpression(CompilationMode mode, object value)
 {
     _mode = mode;
     _value = value;
 }
Exemplo n.º 8
0
 public TotemDynamicExpression2(CallSiteBinder/*!*/ binder, CompilationMode/*!*/ mode, Expression/*!*/ arg0, Expression/*!*/ arg1)
     : base(binder, arg0, arg1)
 {
     Debug.Assert(mode != null);
     _mode = mode;
 }
Exemplo n.º 9
0
        /// <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);
        }