I've been using Oslo for MSchema. Works great. I can write an M Schema for a database design and it generates T-SQL to build the entire db with PKs, FKs, checks for integrity etc. I've set up a .bat file to compile the .m into .mx then load it into the db, then run SqlMetal into my project and in 30 seconds I'm moving on with my chang...
I'm having a hard time wrapping my head around this and need some help understanding shift reduce and reduce reduce conflicts. I have a grammar which I can't seem to understand why it's problematic. I could attach the grammar, but I want to learn how this really works.
First question, what type of parser does MGrammer create? As I under...
I'm sure I'll get told to do it another way, but for specific reasons it has to be done this way. If it didn't, I wouldn't be stuck :-P
The scripting language I'm working on has to accept variables defined like this:
Variables: x(1), y("hi");
This is a requirement. I wrote a small grammar before that would let me define them like t...
I think what I may have is the dangling else problem, but I'm not really sure. The language I'm tasked with writing needs to support multi-line if statements as well as single line i.e.
if(conditions){
print "multi";
print "line";
}
and
if(conditions)
print "single line"
Which in my language corresponds to
if conditions t...
I'm working on a DSL in Microsoft's new M Grammar, and it needs to allow decimal values. I've defined decimal as
token digits = "0".."9";
token spot = ".";
token decimal = digits+ | digits+ spot digits+ | spot digits+;
That seems to work, but is there a better way? It just feels like I'm missing something.
...
I am building up a MGrammar spec to parse some pseudo code looking for particular bits of information. I have most of the spec working except for 1 cruical element.
The pseudo code supports an if-then-else syntax and I have been unable to find a satisfactory way of parsing it. The exact construct is...
IF expression operator expres...
I've been hacking around with the May09 Oslo bits, experimented with tokenizing some source code. I can't seem to figure out how to correctly handle multiline C-style comments though.
For example: /*comment*/
Some cases that elude me:
/***/
or
/**//**/
I can make one or the other work, but not both.
The grammar was:
module Te...
I'm writing a HTML parser for my own amusement and I wanted to try out M.
I base this work on the HTML 4.01 standard and in there it says
Although the STYLE and SCRIPT elements
use CDATA for their data model, for
these elements, CDATA must be handled
differently by user agents. Markup and
entities must be treated as raw tex...
How can I parse blocks of line comments with MGrammar?
I want to parse blocks of line comments. Line comments that are next to each should grouped in the MGraph output.
I'm having trouble grouping blocks of line comments together. My current grammar uses "\r\n\r\n" to terminate a block but that will not work in all cases such as at end...