This project has moved. For the latest updates, please go here.

any documentation?

Feb 17, 2009 at 6:31 PM
I'm just getting started. Great stuff! Was hoping to find some more documentation.  Am I perhaps missing it?

Some specific questions:
What is AddKeywords() accomplish? What should/should not be in the list?

Perhaps related. When to use literal in expression vs. symbol. For example (from SqlGrammar)
      whereClauseOpt.Rule = Empty | "WHERE" + expression;
why is not
      whereClauseOpt.Rule = Empty | WHERE + expression;

Feb 17, 2009 at 6:47 PM
Documentation - none, just the source. The article on CodeProject is quite outdated. Sorry, suxx, I know. One of problems is that project is still evolving, so any documents can quickly fall out of date. Your question about WHERE clause. Remember, grammar definition is in c#, so it should be valid c# statement. In this context, what is the meaning of WHERE thing in your proposed version?
AddKeywords - currently is kinda broken. See thread about language service for some more explanation,will fix it soon.
Feb 17, 2009 at 6:56 PM
One note about literal vs symbol.. If you mean explicitly creating Symbol("WHERE") vs using "WHERE" directly in expression - then no difference. The "+" operator override converts literal into symbol terminal automatically.
Feb 17, 2009 at 9:05 PM
So AddKeywords() is not needed? Does it do anything?
In terms of Symbol(), is there any reason one would or would not define then explicitly?
Feb 17, 2009 at 9:20 PM
It is needed for editor highlighting, to mark the token as keyword so it can be colored properly.
For Symbol method, it is needed if you have sequence of string literals:
Join.Rule = "inner" + "join";
c# compiler would treat it as direct concatenation of two strings, not two symbols that can be separated by spaces; to avoid this, you have to convert one of them explicitly
Join.Rule = Symbol("inner") + "join";
Feb 17, 2009 at 9:25 PM
>Editor highlighting

I don't know what that means in this context. Do you mean in the Irony Grammar Explorer?

Feb 17, 2009 at 9:43 PM
yeah, Grammar Explorer or any other syntax editor that uses Irony to scan/parse the source, like Language Service in VStudio. See other thread and article on CodeProject.
Feb 17, 2009 at 9:53 PM
I didn't see any highlighting in the Grammar Explorer, which is why I had asked.
Feb 17, 2009 at 10:08 PM
that's strange... just checked latest version 20817, it does highlighting of source files in Test page. Load c# grammar in top box, from Irony.Samples.dll, and open source file from SourceSamples folder - you should see c# code colored in the editor
Feb 17, 2009 at 10:29 PM
strange for sure - now I see it (blue highlighting) - Could be my eyes