當前位置: 首頁>>代碼示例>>C#>>正文


C# Forth.getWord方法代碼示例

本文整理匯總了C#中SimpleForth.Forth.getWord方法的典型用法代碼示例。如果您正苦於以下問題:C# Forth.getWord方法的具體用法?C# Forth.getWord怎麽用?C# Forth.getWord使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SimpleForth.Forth的用法示例。


在下文中一共展示了Forth.getWord方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Create

 public static void Create(Forth f)
 {
     string word = f.getWord(' ');
     f.Define(word, MakeLiteralOp((long)f.here));
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:5,代碼來源:Forth.cs

示例2: Backslash

 public static void Backslash(Forth f)
 {
     f.getWord('\n');
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:4,代碼來源:Forth.cs

示例3: LParen

 public static void LParen(Forth f)
 {
     f.getWord(')');
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:4,代碼來源:Forth.cs

示例4: PfBytes

 public static void PfBytes(Forth f)
 {
     if (f.isCompiling)
     {
         string hex = f.getWord(' ');
         f.AppendCode(MakeLiteralOp(HexToBytes(hex)));
     }
     else
     {
         string hex = f.getWord(' ');
         f.dStack.Push(HexToBytes(hex));
     }
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:13,代碼來源:Forth.cs

示例5: DotQuote

 public static void DotQuote(Forth f)
 {
     if (f.isCompiling)
     {
         string str = f.getWord('"');
         f.AppendCode
         (
             delegate(Forth g)
             {
                 Console.Write(str);
             }
         );
     }
     else
     {
         string str = f.getWord('"');
         Console.Write(str);
     }
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:19,代碼來源:Forth.cs

示例6: CreateVocabulary

 public static void CreateVocabulary(Forth f)
 {
     string name = f.getWord(' ');
     Dictionary<string, ForthDictionaryEntry> dict = f.definitions.Dict;
     if (dict.ContainsKey(name)) dict.Remove(name);
     dict.Add(name, new ForthDictionaryEntry(new Vocabulary(name)));
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:7,代碼來源:Forth.cs

示例7: BracketTick

 public static void BracketTick(Forth f)
 {
     if (!f.isCompiling) throw new InvalidOperationException("bracket-tick is only valid when compiling");
     string word = f.getWord(' ');
     ForthDictionaryEntry fde = f.SearchVocabularies(word);
     if (fde == null) throw new InvalidOperationException("attempt to bracket-tick undefined word " + word);
     f.AppendCode(MakeLiteralOp(fde.Proc));
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:8,代碼來源:Forth.cs

示例8: Tick

 public static void Tick(Forth f)
 {
     string word = f.getWord(' ');
     ForthDictionaryEntry fde = f.SearchVocabularies(word);
     if (fde == null) throw new InvalidOperationException("attempt to tick undefined word " + word);
     f.dStack.Push(fde.Proc);
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:7,代碼來源:Forth.cs

示例9: Postpone

 public static void Postpone(Forth f)
 {
     if (!f.isCompiling) throw new InvalidOperationException("postpone is only valid when compiling");
     string word = f.getWord(' ');
     ForthDictionaryEntry fde = f.SearchVocabularies(word);
     if (fde == null) throw new InvalidOperationException("attempt to postpone undefined word " + word);
     if (fde.IsImmediate)
     {
         f.AppendCode(fde.Proc);
     }
     else
     {
         f.AppendCode(MakeLiteralOp(fde.Proc));
         f.AppendCode(new ExecutionToken(PopAndAppendCode));
     }
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:16,代碼來源:Forth.cs

示例10: Define

 public static void Define(Forth f)
 {
     if (!f.compileStack.IsEmpty) throw new InvalidOperationException("Nested definitions are not permitted");
     f.isCompiling = true;
     string localWordBeingCompiled = f.getWord(' ');
     f.compileStack.Push
     (
         new CompileState
         (
             new CompositeWord(),
             delegate(CompositeWord finishedWord)
             {
                 f.Define(localWordBeingCompiled, new ExecutionToken(finishedWord.Run));
             }
         )
     );
 }
開發者ID:Sunlighter,項目名稱:SimpleForth,代碼行數:17,代碼來源:Forth.cs


注:本文中的SimpleForth.Forth.getWord方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。