Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

class/method browser drop down list (box)

<< < (4/4)

Michael:

--- Quote from: Michael on December 18, 2005, 02:49:30 am ---I have worked a bit more in the parser C++ of the Mini C++ interpreter.

--- End quote ---

Let me also add a final ( :wink: ) remark, that could be useful to better understand the Mini C++ interpreter (Mini C++) and its expression parser.

Mini C++ contains three major subsystems:


* The expression parser, which handles numeric expressions
* The interpreter, which actually executes the program
* The set of library functions
The expression parser evaluates a numeric expression and returns the result. The expression can contain constants such as 5 or 99, variables, function calls and operators. For example x-num/5 is an expression.

The interpreter subsystem executes a C++ program. The interpreter works by reading the source code one token at the time. When, it encounters a keyword, it does whatever that keyword request. For example, when the interpreter reads an if, it processes the condition associated with the if. The interpretation continue until the end of the program is reached.

The library subsystem defines those functions that are built into the Mini C++. Thuis, they constitute the Mini C++ "standard library." Only a set of library functions are included, but other can be easily add. In general, the Mini C++ library functions serve the same purpose as the real C++ library functions.

These three subsystems are organized into the following files:


* Parser subsystem --> parser.cpp file
* Interpreter subsystem --> minicpp.cpp fle
* Library subsystem --> libcpp.cpp file
Hope this could help to better understand the Mini C++ and especially its expression parser.

Michael

Navigation

[0] Message Index

[*] Previous page

Go to full version