I need to develop an application that will read and understand a text file in which I will find a special language that describes a list of operations (for example, a cooking recipe). This language has not yet been defined, but it will probably take one of the following forms:
(This code is randomly generated, for example, for the purpose):
begin
repeat(10)
{
bar(toto, 10, 1999, xxx);
}
result = foo(xxxx, 10);
if(foo == ok)
{
...
}
else
{
...
}
end
(This code is randomly generated, for example, for the purpose):
<recipe>
<action name="foo" argument"bar, toto, xxx" repeat=10/>
<action name="bar" argument"xxxxx;10" condition="foo == ok">
<true>...</true>
<false>...</false>
</action>
</recipe>
Regardless of which language is selected, you have to handle simple conditions, cycles.
I have never done this, but at first glance it occurs to me that describing these operations in XML will be simpler and less powerful.
StackOverFlow ANTLR... "The Definitive ANTLR Reference", , , , ...
, , #. , :
(XML, )? ?
, :)
!