예제 #1
0
        static Bridge()
        {
            //xxx temporary
            _any = new NType();
            _nullable_any = new NType();

            string assemblyPath = Reflection.Assembly.GetCallingAssembly().Location;
            string assemblyDirectory = assemblyPath.Substring(
            0, assemblyPath.LastIndexOf("/"));
            string stdLibPath = assemblyDirectory + "/std.toy";

            Node_Module module;

            try {
            module = Acrid.Toy.ToyParser.parseFile(stdLibPath);
            }
            catch(ParseError e) {
            throw new TypeInitializationException(
                String.Format(
                    "Error while parsing standard library:\n{0}\nlocation: {1}",
                    e.Message, e.source),
                e);
            }

            buildStandardLibrary(module);
        }
예제 #2
0
        IScope _scope; //should have already been trimmed for closure

        #endregion Fields

        #region Constructors

        public Function_Client(
	IList<ParameterImpl> parameters, NType returnType,
	INode_Expression body, IScope scope )
        {
            _parameters = parameters;
            _returnType = returnType;
            _body = body;
            _scope = scope;
        }
예제 #3
0
        public Function_Native(
	IList<ParameterImpl> parameters, NType returnType,
	FunctionType function, IScope scope )
        {
            _function = function;
            _parameters = parameters;
            _returnType = returnType;
            _scope = scope;

            if( _scope == null )
            _scope = new Scope(null, new ScopeAllowance(false,false));
        }
예제 #4
0
        public static void declareAssign(
	Identifier name, ScidentreCategory cat,
	NType type, IWorker worker, IScope scope )
        {
            IScidentre ws = scope.reserveScidentre(name, cat);
            ws.type = type;
            ws.assign(worker);
        }