Hi, i have two questions about making a c++ based programming language. the first: is there a c++ function or something that can separate text by commas and parenthesis, so if i wanted to write function foo with argument arg1 and arg2, i would need code to take foo(arg1,arg2) and make them separate strings? second question: how would i write the actual compiler? could i take a simple command line compiler source code and add a (really long) header with all of the new functions, wraps them to c++, and then compiles it?
mebob
0
Junior Poster in Training
Recommended Answers
Jump to PostThis thread give some solutions for tokenizing strings: http://www.daniweb.com/forums/thread27905.html That's what you want to do in your first question. There are lots of ways to pull tokens out of strings.
Secondly, you want to study up on some lex and yacc, a lexical analyzer and a parser, respectively. …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.