Exemple #1
0
        public MainWindow()
        {
            InitializeComponent();

            ContentParser cont = new ContentParser();
            ScriptParser scriptPars = new ScriptParser();

            if (cont.startParse(System.IO.Path.GetFullPath("characters/fate.txt")))
            {
                scr = cont.script;
                scr.addContent();
            }
            else
            {
                System.Windows.MessageBox.Show("Fail Characters");
            }

            try
            {
                LexerParser lexpars = new LexerParser();

                if (lexpars.startParse(System.IO.Path.GetFullPath("new_bidon.txt")))
                {
                    scr = lexpars.script;
                    scr.addContent();
                    ev = new ScriptEval(gScreen);
                }
                else
                {
                    System.Windows.MessageBox.Show("Fail");
                }
            }
            catch (Exception e)
            {
                System.Windows.MessageBox.Show(e.ToString());
                System.Windows.MessageBox.Show(e.StackTrace);
            }

        }
Exemple #2
0
        public bool startParse(string filepath)
        {
            script = new IrisScript();

            //lexBuf.Clear();
            lexBuf = new List<Token>();

            lineNumber = 1;
            colNumber = 1;

            indiceToken = 0;

            try
            {
                fileStream = new StreamReader(filepath);
                codeToParse = fileStream.ReadLine();
            }
            catch (Exception e)
            {
                return false;
            }

            return startParse();
        }
Exemple #3
0
 public static void addScript(IrisScript scr)
 {
     scr.addContent();
 }
Exemple #4
0
 public LexParsa()
 {
     script = new IrisScript();
 }
Exemple #5
0
 public ContentParser()
 {
     script = new IrisScript();
 }