Note that there are some explanatory texts on larger screens.

plurals
  1. POInterpreting custom language
    primarykey
    data
    text
    <p>I need to develop an application that will read and understand text file in which I'll find a custom language that describe a list of operations (ie cooking recipe). This language has not been defined yet, but it will probably take one of the following shape :</p> <ul> <li><strong>C++ like code</strong></li> </ul> <p>(This code is randomly generated, just for example purpose) :</p> <pre><code>begin repeat(10) { bar(toto, 10, 1999, xxx); } result = foo(xxxx, 10); if(foo == ok) { ... } else { ... } end </code></pre> <ul> <li><strong>XML code</strong></li> </ul> <p>(This code is randomly generated, just for example purpose) :</p> <pre><code>&lt;recipe&gt; &lt;action name="foo" argument"bar, toto, xxx" repeat=10/&gt; &lt;action name="bar" argument"xxxxx;10" condition="foo == ok"&gt; &lt;true&gt;...&lt;/true&gt; &lt;false&gt;...&lt;/false&gt; &lt;/action&gt; &lt;/recipe&gt; </code></pre> <p>No matter which language will be chosen, there will have to handle simple conditions, loops.</p> <p>I never did such a thing but at first sight, it occurs to me that describing those operations into XML would be simplier yet less powerful.</p> <p>After browsing StackOverFlow, I've found some chats on a tool called "ANTLR"... I started reading "The Definitive ANTLR Reference" but since I never done that kind of stuff, I find it hard to know if it's really the kind of tool I need...</p> <p>In other words, what do I need to read a text file, interpret it properly and perform actions in my C# code. Those operations will interact between themselves by simple conditions like :</p> <ul> <li>If operation1 failed, I do operation2 else operation3.</li> <li>Repeat the operation4 10 times.</li> </ul> <p>What would be the best language to do describe those text file (XML, my own) ? What are the key points during such developments ?</p> <p>I hope I'm being clear :)</p> <p>Thanks a lot for your help and advices !</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload