public override Verb CreateVerb(string[] tokens)
        {
            Color(position, tokens[1].Length, IDEColor.EntityType.Whitespace);
            string visibility = tokens[2];

            Color(visibility.Length, IDEColor.EntityType.Verb);
            string scope = tokens[3];

            Color(scope.Length, IDEColor.EntityType.Verb);
            ClassParser.SetScopeAndVisibility(scope, visibility, this);
            string messageName = tokens[4];

            Color(messageName.Length, IDEColor.EntityType.Variable);
            Color(tokens[5].Length, IDEColor.EntityType.Structure);

            var              compiler       = new OrangeCompiler(source, position + length);
            Block            parameterBlock = compiler.Compile();
            int              index          = compiler.Position;
            List <Parameter> parameterList  = ParameterParser.GetParameterList(parameterBlock);
            var              parameters     = new Parameters(parameterList);

            if (functionBodyParser.Scan(source, index))
            {
                return(createMethod(messageName, functionBodyParser, parameters, false));
            }
            return(equalBlockParser.Scan(source, index) ? createMethod(messageName, equalBlockParser, parameters, true) : null);
        }
Esempio n. 2
0
        public Value Evaluate()
        {
            string source   = Text;
            var    compiler = new OrangeCompiler(source.Trim());
            Block  block    = compiler.Compile();

            block.Evaluate();
            return(RegionManager.Regions[variableName].Text);
        }
Esempio n. 3
0
        public override Verb CreateVerb(string[] tokens)
        {
            Color(position, tokens[1].Length, IDEColor.EntityType.Verb);
            Color(tokens[2].Length, IDEColor.EntityType.Structure);
            var   compiler = new OrangeCompiler(source, position + length);
            Block block    = compiler.Compile();

            result.Value     = block;
            overridePosition = compiler.Position;
            return(new NullOp());
        }
Esempio n. 4
0
        public override Verb CreateVerb(string[] tokens)
        {
            Color(position, tokens[1].Length, IDEColor.EntityType.Whitespace);
            string visibility = tokens[2];

            Color(visibility.Length, IDEColor.EntityType.Verb);
            string scope = tokens[3];

            Color(scope.Length, IDEColor.EntityType.Verb);
            ClassParser.SetScopeAndVisibility(scope, visibility, this);
            string messageName = tokens[4];

            Color(messageName.Length, IDEColor.EntityType.Variable);
            Color(tokens[5].Length, IDEColor.EntityType.Verb);
            Color(tokens[6].Length, IDEColor.EntityType.Structure);

            int   index    = position + length;
            var   compiler = new OrangeCompiler(source, index);
            Block block    = compiler.Compile();

            result.Position = compiler.Position;
            Builder.AddInitializedVariable(messageName, block, this, null);
            return(new NullOp());
        }