当前位置: 首页>>代码示例>>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;未经允许,请勿转载。