0

I am currently working on a basic Ti-basic compiler, made in C#

It recognizes basic commands like ":Pause" and ":Output", but I would like it to recognize

:Output(1,1, "good ol' ti-basic"

Is it possible to recognize text, then treat it like a function e.g. (int y, int x, string text) ?

So Let's say I have the following string:

string str1 = :Output(1,1, "good ol' ti-basic"

How would I recognize the "Output" part, then divide it in the 3 parts int x, int y and string text?

Something like

// if(str1.contains"Output")
{
  // divide into int x, int y and string text
  // then Console.SetCursorPosition(x, y);
  // Console.Write(text);
}

Is the above possible?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
John
  • 295
  • 1
  • 5
  • 16
  • Writing the parser of the Ti-basic language (or any other language) is not a trivial task. What is exactly that you are asking? How you could parse arguments given to a function? – Pantelis Natsiavas Nov 24 '13 at 11:59
  • 2
    If I understand the questions correctly, you want to write a custom parser for the given language. Can you look through the links in this question and see if they help: http://stackoverflow.com/questions/7377344/how-do-i-write-a-parser-in-c – ChrisK Nov 24 '13 at 12:08
  • Thanks, I am sorry but I did not know that word, "parser", thus making it very hard to find anything about what I wanted. This is pretty much the answer.. – John Nov 24 '13 at 12:11

0 Answers0