OpenKeyWord  Version: 426, Datum:
Parser.cs
1 
2 using System;
3 using System.Collections.Generic;
4 using System.Linq;
5 using System.Text;
6 using System.Threading.Tasks;
7 using System.IO;
8 using Antlr4.Runtime;
9 using Antlr4.Runtime.Misc;
10 using Antlr4.Runtime.Tree;
11 
12 namespace OKW.ANTLR4
13 {
14  public static class MyParser
15  {
31  public static List<string> ParseMe( List<string> fpLsString2Parse )
32  {
33  List<string> lvLsReturn = new List<string>();
34 
35  foreach (string Value in fpLsString2Parse )
36  {
37  lvLsReturn.Add(ParseMe(Value));
38  }
39 
40  return lvLsReturn;
41  }
42 
58  public static string ParseMe( string fpsString2Parse )
59  {
60  StringReader inputStream = new StringReader(fpsString2Parse);
61  AntlrInputStream input = new AntlrInputStream(inputStream.ReadToEnd());
62  OKW_Lexer lexer = new OKW_Lexer(input);
63  CommonTokenStream tokens = new CommonTokenStream(lexer);
64  OKW_Parser parser = new OKW_Parser(tokens);
65  IParseTree tree = parser.root();
66 
67  //Console.WriteLine( tree.ToStringTree(parser));
68  OKW_Visitor visitor = new OKW_Visitor();
69  return visitor.Visit(tree);
70  }
71  }
72 }
static List< string > ParseMe(List< string > fpLsString2Parse)
Parst einen _List< string>, ersetzt die Parser-Schlüsslewörter durch Werte.
Definition: Parser.cs:31
static string ParseMe(string fpsString2Parse)
Parst einen _string und ersetzt die Parser-Schlüsslewörter durch Werte.
Definition: Parser.cs:58
Definition: Core.cs:40