any documentation?

Feb 17, 2009 at 5:31 PM
Hey,
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;

Coordinator
Feb 17, 2009 at 5:47 PM
Hi
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.
Roman
Coordinator
Feb 17, 2009 at 5: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 8: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?
Coordinator
Feb 17, 2009 at 8: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 8:25 PM
>Editor highlighting

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

Thanks,
Chris
Coordinator
Feb 17, 2009 at 8: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 8:53 PM
I didn't see any highlighting in the Grammar Explorer, which is why I had asked.
Coordinator
Feb 17, 2009 at 9: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 9:29 PM
strange for sure - now I see it (blue highlighting) - Could be my eyes