Ejemplo n.º 1
0
        public ProseRuntime()
        {
            global_scope.addProseLanguageWords();

            //	Built-in Words
            word_word   = global_scope.addWordFromRawWord(ProseLanguage.Raw.word);
            word_phrase = global_scope.addWordFromRawWord(ProseLanguage.Raw.phrase);

            //@ words
            @PROSE   = global_scope.addWordFromRawWord(ProseLanguage.Raw.@prose);
            @TEXT    = global_scope.addWordFromRawWord(ProseLanguage.Raw.@text);
            @STRING  = global_scope.addWordFromRawWord(ProseLanguage.Raw.@string);
            @RAW     = global_scope.addWordFromRawWord(ProseLanguage.Raw.@raw);
            @PATTERN = global_scope.addWordFromRawWord(ProseLanguage.Raw.@pattern);
            @ACTION  = global_scope.addWordFromRawWord(ProseLanguage.Raw.@action);
            @BREAK   = global_scope.addWordFromRawWord(ProseLanguage.Raw.@break);

            //	Assign the private symbols at construction time
            COLON     = global_scope.addWordFromRawWord(ProseLanguage.Raw.Colon);
            PERIOD    = global_scope.addWordFromRawWord(ProseLanguage.Raw.Period);
            SEMICOLON = global_scope.addWordFromRawWord(ProseLanguage.Raw.Semicolon);
            COMMA     = global_scope.addWordFromRawWord(ProseLanguage.Raw.Comma);
            QUADQUOTE = global_scope.addWordFromRawWord(ProseLanguage.Raw.Quadquote);

            LEFT_PAREN          = global_scope.addWordFromRawWord(ProseLanguage.Raw.LeftParenthesis);
            RIGHT_PAREN         = global_scope.addWordFromRawWord(ProseLanguage.Raw.RightParenthesis);
            LEFT_SQ_BRACKET     = global_scope.addWordFromRawWord(ProseLanguage.Raw.LeftSquareBracket);
            RIGHT_SQ_BRACKET    = global_scope.addWordFromRawWord(ProseLanguage.Raw.RightSquareBracket);
            LEFT_CURLY_BRACKET  = global_scope.addWordFromRawWord(ProseLanguage.Raw.LeftCurlyBracket);
            RIGHT_CURLY_BRACKET = global_scope.addWordFromRawWord(ProseLanguage.Raw.RightCurlyBracket);

            PLUS_COLON  = global_scope.addWordFromRawWord(ProseLanguage.Raw.PlusColon);
            MINUS_COLON = global_scope.addWordFromRawWord(ProseLanguage.Raw.MinusColon);
            LEFT_ARROW  = global_scope.addWordFromRawWord(ProseLanguage.Raw.LeftArrow);

            COLON_PLUS  = global_scope.addWordFromRawWord(ProseLanguage.Raw.ColonPlus);
            COLON_MINUS = global_scope.addWordFromRawWord(ProseLanguage.Raw.ColonMinus);
            RIGHT_ARROW = global_scope.addWordFromRawWord(ProseLanguage.Raw.RightArrow);


            //	Build the built-in inheritence
            ProseLanguage.constructInitialInheritance(this);

            //	Build the built-in phrases
            ProseLanguage.constructInitialPatternTrie(this);
        }
Ejemplo n.º 2
0
 public void addProseLanguageWords()
 {
     ProseLanguage.constructInitialWordTrie(this);
 }
Ejemplo n.º 3
0
 public MethodNameWord(RawWord[] words, ProseRuntime runtime, ProseLanguage.ActionDelegate delegateMethod )
     : base(words)
 {
     this.delegateMethod = delegateMethod;
     isa = new Word[] { runtime.word("@method") };
 }