This topic is dedicated to the construction of compilers, interpreters and the design of programming languages.
-
14/06/2016
When we are working with mathematical functions, it is very convenient to have a parser that allows us to write and perform different versions of the equations that must be processed by the program, rather than having to modify and recompile the code to adapt it to these changes each time. In this series of articles I will show how to build a simple but powerful expressions analyzer, which can be extended easily to deal with more sophisticated expressions, starting by explaining in this article the basic theory necessary to successfully face this kind of development.
[Read More...] -
17/06/2016
In the previous article in this series I reviewed the main issues about the design of the grammar to build an analyzer, or parser, for arithmetic expressions. In this article I will show the first part of its implementation from the BNF grammar rules, converting the input expression, in the form of a text string, in a series of objects that we can use to evaluate it and give different values to the constants and variables that compose it.
[Read More...] -
18/06/2016
In the previous article in this series I began to show how to implement an arithmetic expression analyzer, or parser, from the grammar rules in BNF notation, with classes which extract numbers, variables and constants. In this article I will finish the series with the implementation of the class focused in working with the main rule, which analyzes the expressions themselves. I will also provide a small sample application that draws the graph corresponding to the expression from the object generated by the compiler.
[Read More...] -
05/01/2017
In this series of articles I will show a class library that implements a compiler that uses any language defined by BNF rules and that generates objects from a user-written class library, which must implement a simple interface so that the compiler can construct and initialize them from the source code.
[Read More...] -
06/01/2017
BNFUP is a class library that implements an object compiler from the definition of a language using BNF rules. It also provides rule editing services. In this article I continue showing how to use the editor to compile and test your own objects using the language you have defined for that. I will also show you three examples of implementation.
[Read More...]