예제 #1
0
파일: Program.cs 프로젝트: FailMelon/Taron
        static void Main(string[] args)
        {
            Lexer lexer = new Lexer();
            TokenStream strm = new TokenStream(lexer.Tokenise(Tests.test_a));
            Parser parser = new Parser();

            Node root;
            try
            {
                root = parser.Parse(strm);
                Console.WriteLine("It worked! {0}", root);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.ReadKey();
                return;
            }

            var behavioursModel = root.As<MapValue>()["Behaviours"].As<MapValue>();

            Dictionary<string, Behaviour> behaviourDict = new Dictionary<string, Behaviour>();
            Translate.Populate(behaviourDict, behavioursModel);

            Console.ReadKey();
        }
예제 #2
0
 static TaronParser()
 {
     lexer = new Lexer();
     parser = new Parser();
 }