<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>irony Forum Rss Feed</title><link>http://www.codeplex.com/irony/Thread/List.aspx</link><description>irony Forum Rss Description</description><item><title>New Post: freeTextLiteral</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75793</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;i need some help.&lt;/p&gt;
&lt;p&gt;i would parse this structur:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;class test
{
Content
}&lt;br&gt;&lt;br&gt;Content is free text.&lt;br&gt;&lt;br&gt;I do it with this definition:&lt;br&gt;&lt;br&gt;&lt;div style="color:Black;background-color:White"&gt;&lt;pre&gt;&lt;span style="color:Blue"&gt;var&lt;/span&gt; compilation_unit = &lt;span style="color:Blue"&gt;new&lt;/span&gt; NonTerminal(&lt;span style="color:#A31515"&gt;&amp;quot;compilation_unit&amp;quot;&lt;/span&gt;);
&lt;span style="color:Blue"&gt;var&lt;/span&gt; class_declaration = &lt;span style="color:Blue"&gt;new&lt;/span&gt; NonTerminal(&lt;span style="color:#A31515"&gt;&amp;quot;class_declaration&amp;quot;&lt;/span&gt;);
&lt;span style="color:Blue"&gt;var&lt;/span&gt; class_body = &lt;span style="color:Blue"&gt;new&lt;/span&gt; NonTerminal(&lt;span style="color:#A31515"&gt;&amp;quot;class_body&amp;quot;&lt;/span&gt;);
&lt;span style="color:Blue"&gt;var&lt;/span&gt; freeTextLiteral = &lt;span style="color:Blue"&gt;new&lt;/span&gt; FreeTextLiteral(&lt;span style="color:#A31515"&gt;&amp;quot;freeTextLiteral&amp;quot;&lt;/span&gt;, &lt;span style="color:#A31515"&gt;&amp;quot;\n&amp;quot;&lt;/span&gt;, &lt;span style="color:#A31515"&gt;&amp;quot;\r&amp;quot;&lt;/span&gt;, Environment.NewLine);
&lt;span style="color:Blue"&gt;var&lt;/span&gt; description = &lt;span style="color:Blue"&gt;new&lt;/span&gt; NonTerminal(&lt;span style="color:#A31515"&gt;&amp;quot;description&amp;quot;&lt;/span&gt;);
IdentifierTerminal identifier = TerminalFactory.CreateCSharpIdentifier(&lt;span style="color:#A31515"&gt;&amp;quot;Identifier&amp;quot;&lt;/span&gt;);

KeyTerm Lbr = ToTerm(&lt;span style="color:#A31515"&gt;&amp;quot;{&amp;quot;&lt;/span&gt;);
KeyTerm Rbr = ToTerm(&lt;span style="color:#A31515"&gt;&amp;quot;}&amp;quot;&lt;/span&gt;);

&lt;span style="color:Blue"&gt;this&lt;/span&gt;.Root = compilation_unit;
compilation_unit.Rule=  class_declaration;
class_declaration.Rule = &lt;span style="color:#A31515"&gt;&amp;quot;class&amp;quot;&lt;/span&gt; + identifier + Lbr +  class_body + Rbr;
class_body.Rule = description;
description.Rule = Empty | freeTextLiteral;&lt;br&gt;&lt;br&gt;But it doesnt work. &lt;br&gt;The error is: &amp;quot;Syntax error, expected: freeTextLiteral. }&amp;quot;&lt;br&gt;&lt;br&gt;The Testdata is:&lt;br&gt;class test&lt;br&gt;{&lt;br&gt;dsfsdfsdf&lt;br&gt;}&lt;br&gt;&lt;br&gt;Can someone help me?&lt;/pre&gt;
&lt;/div&gt;
&lt;br&gt;&lt;/pre&gt;&lt;/div&gt;</description><author>kappos</author><pubDate>Sat, 21 Nov 2009 11:29:33 GMT</pubDate><guid isPermaLink="false">New Post: freeTextLiteral 20091121112933A</guid></item><item><title>New Post: Need help with delimited values</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75741</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I will publish a sample grammar using DsvTerminal for reading some comma-delimited files, it will be clear from an example I hope how to use it.&lt;/p&gt;
&lt;p&gt;good luck&lt;/p&gt;&lt;/div&gt;</description><author>rivantsov</author><pubDate>Fri, 20 Nov 2009 20:04:22 GMT</pubDate><guid isPermaLink="false">New Post: Need help with delimited values 20091120080422P</guid></item><item><title>New Post: Need help with delimited values</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75741</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Great, that should be helpful and reduce my work. I will continue on my original path and use the ParsingContext.Values dictionary to pass custom data between calls.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On a related note, what is an example on where the DsvLiteral would but used?&amp;nbsp; I know it wouldn't help in my scenario, but while researching, I couldn't think of any practical scenario where I would have some delimited text that's being parsed and convert all of the values to one specific System.TypeCode.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;MindCore&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>mindcore</author><pubDate>Fri, 20 Nov 2009 19:30:21 GMT</pubDate><guid isPermaLink="false">New Post: Need help with delimited values 20091120073021P</guid></item><item><title>New Post: Need help with delimited values</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75741</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;If you need to pass some &amp;quot;context&amp;quot; values to formula parser, you can use ParsingContext.Values dictionary - it is for storing custom context, values, whatever, and to exchange this information between terminals or between caller program and terminals or custom processing code in grammar. You can reach the ParsingContext object through parser.Context property right after you create Parser instance but before you call parser.Parse(...)&lt;/p&gt;&lt;/div&gt;</description><author>rivantsov</author><pubDate>Fri, 20 Nov 2009 18:15:03 GMT</pubDate><guid isPermaLink="false">New Post: Need help with delimited values 20091120061503P</guid></item><item><title>New Post: newbie question</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75687</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Well, you should first be aware of two-step parsing process:&lt;/p&gt;
&lt;p&gt;1. Scanning - recognizing chunks of chars like numbers, identifiers, keywords and combining them into tokens. This is also called lexical analysis, and rules for this operation are lexical rules.&lt;/p&gt;
&lt;p&gt;2. Parsing itself - reading token stream from scanner and recognizing language constructs like expressions, statements, etc.&amp;nbsp; This is syntax analysis.&lt;/p&gt;
&lt;p&gt;When defining a grammar for a language, language spec often describes both lexical rules and syntax rules in the same manner. However, for language impelementor it is important to separate these, and identify which are lexical rules and what are syntax rules (rules over tokens). It is true for any compiler tool, and important for Irony because lexical rules are supported internally in&amp;nbsp;different way.&amp;nbsp;What you listed are lexical rules, rules over chars for combining them into tokens. These rules are&amp;nbsp;implemented in Irony through predefined Terminal classes. So what you need to do is identify appropriate&amp;nbsp;terminal classes (IdentifierTerminal, NumberLiteral, etc), instantiate them as&amp;nbsp;local variables and set various options on them that&amp;nbsp;match your lexical rules.&lt;/p&gt;
&lt;p&gt;I see that you probably would need&amp;nbsp;IdentifierTerminal, NumberLiteral, maybe some others.&lt;/p&gt;
&lt;p&gt;Try&amp;nbsp;to understand what are restrictions on&amp;nbsp;terminals expressed by&amp;nbsp;your lexical rules and set the options of Irony terminals appropriately. Follow the examples in Irony.Samples grammar, and also in TerminalFactory methods&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>rivantsov</author><pubDate>Fri, 20 Nov 2009 18:09:06 GMT</pubDate><guid isPermaLink="false">New Post: newbie question 20091120060906P</guid></item><item><title>New Post: Need help with delimited values</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75741</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I have a file that I would like to parse that is made up of pipe delimited lines of text where the first value describes the type of line it is.&amp;nbsp; So for example, the file may look something like this:&lt;/p&gt;
&lt;p&gt;ABC | Name | Description | 01234ClienNo | 01-01-1900 | | true&lt;br&gt; L1 | Name | Description | formula&lt;br&gt; D1 | Name | 03-15-2010 | N&lt;br&gt; DA | D1 | Line 1 | formula&lt;br&gt; DB | D1 | Line 2 | formula&lt;br&gt;...&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note that DA and DB are children under D1 and some fields like Description can span multiple lines, but each line type has a set number of fields.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Anyhow, I am currently using the System.String Split method and I'm leaning toward switching to Irony so that the result would be a tree and the lines with formulas would continued to be parsed and maintain awareness of their child/parent relationship.&amp;nbsp; Originally, I felt that I could continue to use this design and simply parse the formulas, however, Irony seems to have no way to pass the parser meta data to maintain the needed awareness.&lt;/p&gt;
&lt;p&gt;The only meta data that seems to be passed in is a filename string which defaults to &amp;lt;source&amp;gt; - referring to the Parse methods in Parser.cs.&lt;/p&gt;
&lt;p&gt;So,&amp;nbsp; what's the most efficient way to handle this scenario? Should I continue to use the Split method from System.String and only use the Parser for the formulas, or is there an easier way for Irony to parse the pipe delimited data and the formulas together while maintaining it's parent/child relationship?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br&gt; MindCore&lt;/p&gt;&lt;/div&gt;</description><author>mindcore</author><pubDate>Fri, 20 Nov 2009 17:16:27 GMT</pubDate><guid isPermaLink="false">New Post: Need help with delimited values 20091120051627P</guid></item><item><title>New Post: newbie question</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75687</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;First sorry for the simple question. I am new to Irony and i want to build a parser for ASL(ACPI Source Language).&lt;/p&gt;
&lt;p&gt;Here is a snippet of ASL name and pathname terms definition.&lt;/p&gt;
&lt;p&gt;LeadNameChar := &amp;lsquo;A&amp;rsquo;-&amp;lsquo;Z&amp;rsquo; | &amp;lsquo;a&amp;rsquo;-&amp;lsquo;z&amp;rsquo; | &amp;lsquo;_&amp;rsquo; &lt;br&gt;DigitChar := &amp;lsquo;0&amp;rsquo;-&amp;lsquo;9&amp;rsquo; &lt;br&gt;NameChar := DigitChar | LeadNameChar &lt;br&gt;RootChar := &amp;lsquo;\&amp;rsquo; &lt;br&gt;ParentPrefixChar := &amp;lsquo;^&amp;rsquo; &lt;br&gt;PathSeparatorChar := &amp;lsquo;.&amp;rsquo; &lt;br&gt;CommaChar := &amp;lsquo;,&amp;rsquo; &lt;br&gt;SemicolonDelimiter := Nothing | &amp;lsquo;;&amp;rsquo;&lt;/p&gt;
&lt;p&gt;NameSeg := &amp;lt;LeadNameChar&amp;gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| &amp;lt;LeadNameChar NameChar&amp;gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| &amp;lt;LeadNameChar NameChar NameChar&amp;gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| &amp;lt;LeadNameChar NameChar NameChar NameChar&amp;gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;NameString := &amp;lt;RootChar NamePath&amp;gt; | &amp;lt;ParentPrefixChar PrefixPath NamePath&amp;gt; | NonEmptyNamePath &lt;br&gt;NamePath := Nothing | &amp;lt;NameSeg NamePathTail&amp;gt; &lt;br&gt;NamePathTail := Nothing | &amp;lt;PathSeparatorChar NameSeg NamePathTail&amp;gt; &lt;br&gt;NonEmptyNamePath := NameSeg | &amp;lt;NameSeg NamePathTail&amp;gt; &lt;br&gt;PrefixPath := Nothing | &amp;lt;ParentPrefixChar PrefixPath&amp;gt;&lt;/p&gt;
&lt;p&gt;I defines the rootchar,commachar and etc as:&lt;br&gt;KeyTerm commaChar = ToTerm(&amp;quot;,&amp;quot;, &amp;quot;commaChar&amp;quot;);&lt;br&gt;KeyTerm parentPrefixChar = ToTerm(&amp;quot;^&amp;quot;, &amp;quot;parentPrefixChar&amp;quot;);&lt;br&gt;KeyTerm pathSeperateorChar = ToTerm(&amp;quot;.&amp;quot;, &amp;quot;pathSeperateorChar&amp;quot;);&lt;br&gt;KeyTerm rootChar = ToTerm(&amp;quot;&lt;a&gt;\\&amp;quot;,&amp;quot;rootChar&lt;/a&gt;&amp;quot;);&lt;/p&gt;
&lt;p&gt;Am i right? And i don't know how to define LeadNameChar and DigitChar and so as NameSeg, Will anybody help me?&lt;/p&gt;&lt;/div&gt;</description><author>ak756</author><pubDate>Fri, 20 Nov 2009 07:32:58 GMT</pubDate><guid isPermaLink="false">New Post: newbie question 20091120073258A</guid></item><item><title>New Post: Ambiguous FreeTextLiteral</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75375</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I've seen this behavior in debugger, but I've been assured&amp;nbsp;that works fine )&amp;nbsp;I thought the problem is in my usage of Irony.&lt;/p&gt;
&lt;p&gt;Undoubtedly I'll wait for the newest release where it fixed, because it's simplest then doing the same on any *cc toolkit!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thank you! )&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;</description><author>DenisKolodin</author><pubDate>Thu, 19 Nov 2009 03:51:45 GMT</pubDate><guid isPermaLink="false">New Post: Ambiguous FreeTextLiteral 20091119035145A</guid></item><item><title>New Post: Ambiguous FreeTextLiteral</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75375</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;By the way, quite similar issue is reported in latest bug opened in Issue Tracker page. Need to fix it finally&lt;/p&gt;
&lt;p&gt;Roman&lt;/p&gt;&lt;/div&gt;</description><author>rivantsov</author><pubDate>Wed, 18 Nov 2009 21:44:11 GMT</pubDate><guid isPermaLink="false">New Post: Ambiguous FreeTextLiteral 20091118094411P</guid></item><item><title>New Post: Ambiguous FreeTextLiteral</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75375</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I see the problem now. If you look at your first screenshot, in the right-bottom corner, you see token list. The second token produced by scanner is &amp;quot;FIRM&amp;quot; - an identifier token you defined for firms. It is Irony's inconsistency in dealing with terminals without prefixes, long outstanding item. The trouble is Scanner.SelectTerminals method. No-prefix terminals are picked up for consideration ONLY if there are no other candidates with prefixes. In your case there is one candidate - &amp;quot;Firm&amp;quot; identifier, so it leaves out the FREE_TEXT which is in FallbackTerminals. This is wrong, it should be fixed, I simply did not come up yet with consistent and reliable fix for this - this is actually more than a fix, it is sort of refactoring and change of entire scanning algorithm. Until now this bug manifested itself in little inconsistencies but your case is blown up by this. Sorry, will get to this ASAP. For now, add all Latin upper and lower letters to Firsts list of FreeTextLiterals you use - yes, it looks silly, and it would work only for English, but would work until the fix is there.&lt;/p&gt;
&lt;p&gt;Sorry again&lt;/p&gt;
&lt;p&gt;Roman&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>rivantsov</author><pubDate>Wed, 18 Nov 2009 21:41:48 GMT</pubDate><guid isPermaLink="false">New Post: Ambiguous FreeTextLiteral 20091118094148P</guid></item><item><title>New Post: Ambiguous FreeTextLiteral</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75375</link><description>&lt;div style="line-height: normal;"&gt;&lt;div style="color:Black;background-color:White"&gt;
&lt;pre&gt;&lt;span style="font-family:'Segoe UI', 'Microsoft Sans Serif', Arial, Geneva, sans-serif;white-space:normal"&gt;I've tried different rules with semicolon and linebreak. They didn't give the result I need. But i still one change:&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="color:black;background-color:white"&gt;
&lt;pre style="color:#000000;font-family:Consolas, 'Courier New', Courier, monospace;font-size:1em;margin:8px"&gt;          &lt;span style="color:blue"&gt;var&lt;/span&gt; FREE_TEXT = &lt;span style="color:blue"&gt;new&lt;/span&gt; FreeTextLiteral(&lt;span style="color:#a31515"&gt;&amp;quot;FREE_TEXT&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515"&gt;&amp;quot;;&amp;quot;&lt;/span&gt;); // &amp;quot;\n&amp;quot; removed
&lt;/pre&gt;
&lt;div&gt;&lt;span style="font-family:Consolas, 'Courier New', Courier, monospace"&gt;&lt;span style="white-space:pre"&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;I made 2 screenshots how it works with grammar:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://picasaweb.google.com/DenisKolodin/PublicScreenshots#5405524059530328114"&gt;Screenshot when parsing fails&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://picasaweb.google.com/DenisKolodin/PublicScreenshots#5405524062347731970"&gt;Screenshot when it works well&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As you can see I add prefix for token. The prefix is '@'. And parsing works right. When free text starts with any char which can be start of terminal FIRM it doesn't work (&lt;br&gt; If i add a char to Firsts list of FreeTextLiteral it will work but when text starts with this char.&amp;nbsp;But as I said I want free text can starts with any character (including latin).&lt;br&gt; It isn't good idea to add all latin chars to Firsts list, is it?&lt;br&gt; And more about parsing error. I try to parse text:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;PORTFOLIO_EX &lt;span style="color:#ff0000"&gt;&lt;span style="text-decoration:underline"&gt;T&lt;/span&gt;&lt;/span&gt;he very long name of portfolio;&lt;/em&gt;&lt;br&gt; &lt;em&gt;DESCRIPTION Any description. You can write much here;&lt;/em&gt;&lt;br&gt; &lt;em&gt;FIRMS_LIST ALL_FIRMS;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Error happens at L,C (0, 13). It highlighted red in the parsing text.&lt;br&gt; Error message: Syntax error, expected: FREE_TEXT&lt;br&gt; Parser state: S4&lt;/p&gt;
&lt;p&gt;All parser states is below (sorry for the size):&lt;/p&gt;
&lt;p&gt;&amp;lt;small&amp;gt; State S0 &lt;br&gt; Shift items: &lt;br&gt; PORTFOLIO' -&amp;gt; &amp;middot;PORTFOLIO EOF  &lt;br&gt; PORTFOLIO -&amp;gt; &amp;middot;METADATA  &lt;br&gt; METADATA -&amp;gt; &amp;middot;PORTFOLIO_EX DESCRIPTION FIRMS  &lt;br&gt; PORTFOLIO_EX -&amp;gt; &amp;middot;PORTFOLIO_EX FREE_TEXT LINE_END  &lt;br&gt; PORTFOLIO_EX -&amp;gt; &amp;middot;PORTFOLIO FREE_TEXT LINE_END  &lt;br&gt; Transitions: PORTFOLIO-&amp;gt;S1, METADATA-&amp;gt;S2, PORTFOLIO_EX-&amp;gt;S3, PORTFOLIO_EX-&amp;gt;S4, PORTFOLIO-&amp;gt;S5,  &lt;br&gt; &lt;br&gt; State S1 &lt;br&gt; Shift items: &lt;br&gt; PORTFOLIO' -&amp;gt; PORTFOLIO &amp;middot;EOF  &lt;br&gt; &lt;br&gt; State S2 &lt;br&gt; Reduce items: &lt;br&gt; PORTFOLIO -&amp;gt; METADATA &amp;middot; [EOF] &lt;br&gt; &lt;br&gt; State S3 &lt;br&gt; Shift items: &lt;br&gt; METADATA -&amp;gt; PORTFOLIO_EX &amp;middot;DESCRIPTION FIRMS  &lt;br&gt; DESCRIPTION -&amp;gt; &amp;middot;DESCRIPTION FREE_TEXT LINE_END  &lt;br&gt; Transitions: DESCRIPTION-&amp;gt;S7, DESCRIPTION-&amp;gt;S8,  &lt;br&gt; &lt;br&gt; State S4 &lt;br&gt; Shift items: &lt;br&gt; PORTFOLIO_EX -&amp;gt; PORTFOLIO_EX &amp;middot;FREE_TEXT LINE_END  &lt;br&gt; Transitions: FREE_TEXT-&amp;gt;S9,  &lt;br&gt; &lt;br&gt; State S5 &lt;br&gt; Shift items: &lt;br&gt; PORTFOLIO_EX -&amp;gt; PORTFOLIO &amp;middot;FREE_TEXT LINE_END  &lt;br&gt; Transitions: FREE_TEXT-&amp;gt;S10,  &lt;br&gt; &lt;br&gt; State S6 &lt;br&gt; Reduce items: &lt;br&gt; PORTFOLIO' -&amp;gt; PORTFOLIO EOF &amp;middot; [] &lt;br&gt; &lt;br&gt; State S7 &lt;br&gt; Shift items: &lt;br&gt; METADATA -&amp;gt; PORTFOLIO_EX DESCRIPTION &amp;middot;FIRMS  &lt;br&gt; FIRMS -&amp;gt; &amp;middot;FIRMS_LIST FIRMS_VARIATIONS LINE_END  &lt;br&gt; Transitions: FIRMS-&amp;gt;S11, FIRMS_LIST-&amp;gt;S12,  &lt;br&gt; &lt;br&gt; State S8 &lt;br&gt; Shift items: &lt;br&gt; DESCRIPTION -&amp;gt; DESCRIPTION &amp;middot;FREE_TEXT LINE_END  &lt;br&gt; Transitions: FREE_TEXT-&amp;gt;S13,  &lt;br&gt; &lt;br&gt; State S9 &lt;br&gt; Shift items: &lt;br&gt; PORTFOLIO_EX -&amp;gt; PORTFOLIO_EX FREE_TEXT &amp;middot;LINE_END  &lt;br&gt; LINE_END -&amp;gt; &amp;middot;SEMICOLON LF  &lt;br&gt; Transitions: LINE_END-&amp;gt;S14, SEMICOLON-&amp;gt;S15,  &lt;br&gt; &lt;br&gt; State S10 &lt;br&gt; Shift items: &lt;br&gt; PORTFOLIO_EX -&amp;gt; PORTFOLIO FREE_TEXT &amp;middot;LINE_END  &lt;br&gt; LINE_END -&amp;gt; &amp;middot;SEMICOLON LF  &lt;br&gt; Transitions: LINE_END-&amp;gt;S16, SEMICOLON-&amp;gt;S15,  &lt;br&gt; &lt;br&gt; State S11 &lt;br&gt; Reduce items: &lt;br&gt; METADATA -&amp;gt; PORTFOLIO_EX DESCRIPTION FIRMS &amp;middot; [EOF] &lt;br&gt; &lt;br&gt; State S12 &lt;br&gt; Shift items: &lt;br&gt; FIRMS -&amp;gt; FIRMS_LIST &amp;middot;FIRMS_VARIATIONS LINE_END  &lt;br&gt; FIRMS_VARIATIONS -&amp;gt; &amp;middot;ALL_FIRMS  &lt;br&gt; FIRMS_VARIATIONS -&amp;gt; &amp;middot;FIRMS_LIST  &lt;br&gt; FIRMS_LIST -&amp;gt; &amp;middot;FIRM  &lt;br&gt; FIRMS_LIST -&amp;gt; &amp;middot;FIRMS_LIST COMMA FIRM  &lt;br&gt; Transitions: FIRMS_VARIATIONS-&amp;gt;S17, ALL_FIRMS-&amp;gt;S18, FIRMS_LIST-&amp;gt;S19, FIRM-&amp;gt;S20,  &lt;br&gt; &lt;br&gt; State S13 &lt;br&gt; Shift items: &lt;br&gt; DESCRIPTION -&amp;gt; DESCRIPTION FREE_TEXT &amp;middot;LINE_END  &lt;br&gt; LINE_END -&amp;gt; &amp;middot;SEMICOLON LF  &lt;br&gt; Transitions: LINE_END-&amp;gt;S21, SEMICOLON-&amp;gt;S15,  &lt;br&gt; &lt;br&gt; State S14 &lt;br&gt; Reduce items: &lt;br&gt; PORTFOLIO_EX -&amp;gt; PORTFOLIO_EX FREE_TEXT LINE_END &amp;middot; [DESCRIPTION] &lt;br&gt; &lt;br&gt; State S15 &lt;br&gt; Shift items: &lt;br&gt; LINE_END -&amp;gt; SEMICOLON &amp;middot;LF  &lt;br&gt; Transitions: [line break]-&amp;gt;S22,  &lt;br&gt; &lt;br&gt; State S16 &lt;br&gt; Reduce items: &lt;br&gt; PORTFOLIO_EX -&amp;gt; PORTFOLIO FREE_TEXT LINE_END &amp;middot; [DESCRIPTION] &lt;br&gt; &lt;br&gt; State S17 &lt;br&gt; Shift items: &lt;br&gt; FIRMS -&amp;gt; FIRMS_LIST FIRMS_VARIATIONS &amp;middot;LINE_END  &lt;br&gt; LINE_END -&amp;gt; &amp;middot;SEMICOLON LF  &lt;br&gt; Transitions: LINE_END-&amp;gt;S23, SEMICOLON-&amp;gt;S15,  &lt;br&gt; &lt;br&gt; State S18 &lt;br&gt; Reduce items: &lt;br&gt; FIRMS_VARIATIONS -&amp;gt; ALL_FIRMS &amp;middot; [SEMICOLON] &lt;br&gt; &lt;br&gt; State S19 (Inadequate) &lt;br&gt; Shift items: &lt;br&gt; FIRMS_LIST -&amp;gt; FIRMS_LIST &amp;middot;COMMA FIRM  &lt;br&gt; Reduce items: &lt;br&gt; FIRMS_VARIATIONS -&amp;gt; FIRMS_LIST &amp;middot; [SEMICOLON] &lt;br&gt; Transitions: COMMA-&amp;gt;S24,  &lt;br&gt; &lt;br&gt; State S20 &lt;br&gt; Reduce items: &lt;br&gt; FIRMS_LIST -&amp;gt; FIRM &amp;middot; [COMMA SEMICOLON] &lt;br&gt; &lt;br&gt; State S21 &lt;br&gt; Reduce items: &lt;br&gt; DESCRIPTION -&amp;gt; DESCRIPTION FREE_TEXT LINE_END &amp;middot; [FIRMS_LIST] &lt;br&gt; &lt;br&gt; State S22 &lt;br&gt; Reduce items: &lt;br&gt; LINE_END -&amp;gt; SEMICOLON LF &amp;middot; [EOF DESCRIPTION FIRMS_LIST] &lt;br&gt; &lt;br&gt; State S23 &lt;br&gt; Reduce items: &lt;br&gt; FIRMS -&amp;gt; FIRMS_LIST FIRMS_VARIATIONS LINE_END &amp;middot; [EOF] &lt;br&gt; &lt;br&gt; State S24 &lt;br&gt; Shift items: &lt;br&gt; FIRMS_LIST -&amp;gt; FIRMS_LIST COMMA &amp;middot;FIRM  &lt;br&gt; Transitions: FIRM-&amp;gt;S25,  &lt;br&gt; &lt;br&gt; State S25 &lt;br&gt; Reduce items: &lt;br&gt; FIRMS_LIST -&amp;gt; FIRMS_LIST COMMA FIRM &amp;middot; [COMMA SEMICOLON]&amp;nbsp;&amp;lt;/small&amp;gt;&lt;/p&gt;
&lt;p&gt;Roman, thanks for your desire to help! )&lt;/p&gt;
&lt;p&gt;It's possible to scan and parse hard grammars like C# or SQL with Irony.&lt;br&gt; I'm sure it have to work for my task! What can I try else?&lt;/p&gt;&lt;/div&gt;</description><author>DenisKolodin</author><pubDate>Wed, 18 Nov 2009 20:15:14 GMT</pubDate><guid isPermaLink="false">New Post: Ambiguous FreeTextLiteral 20091118081514P</guid></item><item><title>New Post: Ambiguous FreeTextLiteral</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75375</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;It would be helpful next time if you provide a sample that you try to parse and also point to the exact place when parser reports an error.&lt;/p&gt;
&lt;p&gt;But from what I see my guess would be that the trouble is in PORTFOLIO_EX definition - it should not have LINE_END in both clauses. Semicolon and linebreak are defined as terminators for FREE_TEXT elements and are consumed by this element - in the sense that when parser completes reading FREE_TEXT, the current position of the scanner is at the beginning of the next line, after &amp;quot;\n&amp;quot;. But parser still wants to see&amp;nbsp;LINE_END, because it is specified in the rule.&lt;/p&gt;
&lt;p&gt;So just try removing LINE_END from PORTFOLIO_EX rule. Let me know if it works. If it's not the problem, then please provide a sample and failure position&lt;/p&gt;
&lt;p&gt;Roman&lt;/p&gt;&lt;/div&gt;</description><author>rivantsov</author><pubDate>Wed, 18 Nov 2009 16:40:45 GMT</pubDate><guid isPermaLink="false">New Post: Ambiguous FreeTextLiteral 20091118044045P</guid></item><item><title>New Post: Ambiguous FreeTextLiteral</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75375</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I want to see a free text in the parse tree so I haven't added FreeTextLiteral to NonGrammarTerminals.&lt;br&gt; And FreeTextTerminal is always in the list of FallBackTerminals.&lt;br&gt; I have to scan and parse a text like this:&lt;/p&gt;
&lt;p&gt;&lt;em&gt; PORTFOLIO_EX Portfolio name;&lt;br&gt; DESCRIPTION Any description;&lt;br&gt; FIRMS_LIST ALL_FIRMS;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I wrote the code below for it:&lt;/p&gt;
&lt;div style="color:Black;background-color:White"&gt;
&lt;pre&gt;          &lt;span style="color:Blue"&gt;var&lt;/span&gt; PORTFOLIO = &lt;span style="color:Blue"&gt;new&lt;/span&gt; NonTerminal(&lt;span style="color:#A31515"&gt;&amp;quot;PORTFOLIO&amp;quot;&lt;/span&gt;);
          &lt;span style="color:Blue"&gt;var&lt;/span&gt; METADATA = &lt;span style="color:Blue"&gt;new&lt;/span&gt; NonTerminal(&lt;span style="color:#A31515"&gt;&amp;quot;METADATA&amp;quot;&lt;/span&gt;);
          &lt;span style="color:Blue"&gt;var&lt;/span&gt; PORTFOLIO_EX = &lt;span style="color:Blue"&gt;new&lt;/span&gt; NonTerminal(&lt;span style="color:#A31515"&gt;&amp;quot;PORTFOLIO_EX&amp;quot;&lt;/span&gt;);
          &lt;span style="color:Blue"&gt;var&lt;/span&gt; DESCRIPTION = &lt;span style="color:Blue"&gt;new&lt;/span&gt; NonTerminal(&lt;span style="color:#A31515"&gt;&amp;quot;DESCRIPTION&amp;quot;&lt;/span&gt;);
          &lt;span style="color:Blue"&gt;var&lt;/span&gt; FIRMS = &lt;span style="color:Blue"&gt;new&lt;/span&gt; NonTerminal(&lt;span style="color:#A31515"&gt;&amp;quot;FIRMS&amp;quot;&lt;/span&gt;);
          &lt;span style="color:Blue"&gt;var&lt;/span&gt; LINE_END = &lt;span style="color:Blue"&gt;new&lt;/span&gt; NonTerminal(&lt;span style="color:#A31515"&gt;&amp;quot;LINE_END&amp;quot;&lt;/span&gt;);
          &lt;span style="color:Blue"&gt;var&lt;/span&gt; FIRMS_VARIATIONS = &lt;span style="color:Blue"&gt;new&lt;/span&gt; NonTerminal(&lt;span style="color:#A31515"&gt;&amp;quot;FIRMS_VARIATIONS&amp;quot;&lt;/span&gt;);
          &lt;span style="color:Blue"&gt;var&lt;/span&gt; FIRMS_LIST = &lt;span style="color:Blue"&gt;new&lt;/span&gt; NonTerminal(&lt;span style="color:#A31515"&gt;&amp;quot;FIRMS_LIST&amp;quot;&lt;/span&gt;);

          &lt;span style="color:Blue"&gt;var&lt;/span&gt; FREE_TEXT = &lt;span style="color:Blue"&gt;new&lt;/span&gt; FreeTextLiteral(&lt;span style="color:#A31515"&gt;&amp;quot;FREE_TEXT&amp;quot;&lt;/span&gt;, &lt;span style="color:#A31515"&gt;&amp;quot;;&amp;quot;&lt;/span&gt;, &lt;span style="color:#A31515"&gt;&amp;quot;\n&amp;quot;&lt;/span&gt;);
          &lt;span style="color:Blue"&gt;var&lt;/span&gt; SEMICOLON = ToTerm(&lt;span style="color:#A31515"&gt;&amp;quot;;&amp;quot;&lt;/span&gt;, &lt;span style="color:#A31515"&gt;&amp;quot;SEMICOLON&amp;quot;&lt;/span&gt;);
          &lt;span style="color:Blue"&gt;var&lt;/span&gt; COMMA = ToTerm(&lt;span style="color:#A31515"&gt;&amp;quot;,&amp;quot;&lt;/span&gt;, &lt;span style="color:#A31515"&gt;&amp;quot;COMMA&amp;quot;&lt;/span&gt;);
          &lt;span style="color:Blue"&gt;var&lt;/span&gt; FIRM = &lt;span style="color:Blue"&gt;new&lt;/span&gt; IdentifierTerminal(&lt;span style="color:#A31515"&gt;&amp;quot;FIRM&amp;quot;&lt;/span&gt;);


          &lt;span style="color:Blue"&gt;this&lt;/span&gt;.Root = PORTFOLIO;
          PORTFOLIO.Rule = METADATA;
          METADATA.Rule = PORTFOLIO_EX + DESCRIPTION + FIRMS;
          PORTFOLIO_EX.Rule = &lt;span style="color:#A31515"&gt;&amp;quot;PORTFOLIO_EX&amp;quot;&lt;/span&gt; + FREE_TEXT + LINE_END | &lt;span style="color:#A31515"&gt;&amp;quot;PORTFOLIO&amp;quot;&lt;/span&gt; + FREE_TEXT + LINE_END;
          DESCRIPTION.Rule = &lt;span style="color:#A31515"&gt;&amp;quot;DESCRIPTION&amp;quot;&lt;/span&gt; + FREE_TEXT + LINE_END;
          FIRMS.Rule = &lt;span style="color:#A31515"&gt;&amp;quot;FIRMS_LIST&amp;quot;&lt;/span&gt; + FIRMS_VARIATIONS + LINE_END;
          FIRMS_VARIATIONS.Rule = &lt;span style="color:#A31515"&gt;&amp;quot;ALL_FIRMS&amp;quot;&lt;/span&gt; | FIRMS_LIST;
          FIRMS_LIST.Rule = MakePlusRule(FIRMS_LIST, COMMA, FIRM);
          LINE_END.Rule = SEMICOLON + NewLine;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;And it's not working (&lt;/p&gt;
&lt;p&gt;Maybe, are there defects in the rules?&lt;/p&gt;&lt;/div&gt;</description><author>DenisKolodin</author><pubDate>Tue, 17 Nov 2009 20:09:41 GMT</pubDate><guid isPermaLink="false">New Post: Ambiguous FreeTextLiteral 20091117080941P</guid></item><item><title>New Post: Ambiguous FreeTextLiteral</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75375</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;First, do you use this FreeTextLiteral in any of the rules? if not, you should add it to NonGrammarTerminals.&lt;/p&gt;
&lt;p&gt;Otherwise, if it is used somewhere, then Scanner should find it. If it does not define any Firsts prefixes (GetFirsts() return null or empty list), it should be automatically added to FallbackTerminals. Step thru the process and check that this is so (stop when scanner tries to find a terminal and check that your FreeTextTerminal is in the list of FallBackTerminals)&lt;/p&gt;
&lt;p&gt;Let me know the results&lt;/p&gt;
&lt;p&gt;Roman&lt;/p&gt;&lt;/div&gt;</description><author>rivantsov</author><pubDate>Tue, 17 Nov 2009 17:52:00 GMT</pubDate><guid isPermaLink="false">New Post: Ambiguous FreeTextLiteral 20091117055200P</guid></item><item><title>New Post: Ambiguous FreeTextLiteral</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=75375</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hello!&lt;br&gt; I have a problem with scanning of FreeTextLiteral.&lt;br&gt; That one was detected when input text starts with any character missing in hash table.&lt;br&gt; How to create Terminal which fits free text starts with any character (including latin characters).&lt;br&gt; Can anybody help me?&lt;/p&gt;&lt;/div&gt;</description><author>DenisKolodin</author><pubDate>Tue, 17 Nov 2009 17:45:05 GMT</pubDate><guid isPermaLink="false">New Post: Ambiguous FreeTextLiteral 20091117054505P</guid></item><item><title>New Post: Macro expansion</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=74018</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&amp;quot;one token ahead&amp;quot;, for &amp;quot;macro&amp;quot; in Identifier + macro - yes, you interpret it right, macro is not considered this one token lookahead when parser in the position before identifier, it is identifier itself. The trouble is that at this point Parser must make a decision between 2 or more alternatives, and all it sees is CurrentToken (identifier), which IS the single lookahead token.&lt;/p&gt;
&lt;p&gt;About built-in automatic lookup facility for cases like this - I actually thought about this, and it may be possible, but I didnt' figure out details yet. I may come back to this in the future&lt;/p&gt;
&lt;p&gt;Roman&lt;/p&gt;&lt;/div&gt;</description><author>rivantsov</author><pubDate>Sat, 14 Nov 2009 16:38:55 GMT</pubDate><guid isPermaLink="false">New Post: Macro expansion 20091114043855P</guid></item><item><title>New Post: Identifier results when grammar is case insensitive</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=70836</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The issue is fixed in the latest drop. It turned out the problem was a bit deeper that one would expect, it was actually several problems spread out in several places. Now all identifiers show up &amp;quot;as is&amp;quot;, with original casing even in case-insensitive languages. It became interpreter's responsibility to handle case variations if language is case insensitive - by creating case-insesitive dictionaries for local and global variables&lt;/p&gt;
&lt;p&gt;thanks again&lt;/p&gt;
&lt;p&gt;Roman&lt;/p&gt;&lt;/div&gt;</description><author>rivantsov</author><pubDate>Sat, 14 Nov 2009 16:33:14 GMT</pubDate><guid isPermaLink="false">New Post: Identifier results when grammar is case insensitive 20091114043314P</guid></item><item><title>New Post: Identifier results when grammar is case insensitive</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=70836</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Thanks for following up.&lt;/p&gt;&lt;/div&gt;</description><author>MindCore</author><pubDate>Thu, 12 Nov 2009 01:15:36 GMT</pubDate><guid isPermaLink="false">New Post: Identifier results when grammar is case insensitive 20091112011536A</guid></item><item><title>New Post: Identifier results when grammar is case insensitive</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=70836</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I'm back to this issue, and I'm able to reproduce it. With GwBasic grammar and script like this:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small"&gt;&lt;span lang=EN&gt;
&lt;p&gt;1 x = xX&lt;/p&gt;
&lt;p&gt;2 y = xX * 2&lt;/p&gt;
&lt;p&gt;The first occurrence of xX shows as &amp;quot;xX&amp;quot; in parse tree, while the second one is &amp;quot;xx&amp;quot;&lt;/p&gt;
&lt;p&gt;Will investigate and fix it.&lt;/p&gt;
&lt;p&gt;Good catch! - thanks again!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</description><author>rivantsov</author><pubDate>Wed, 11 Nov 2009 14:44:27 GMT</pubDate><guid isPermaLink="false">New Post: Identifier results when grammar is case insensitive 20091111024427P</guid></item><item><title>New Post: Macro expansion</title><link>http://irony.codeplex.com/Thread/View.aspx?ThreadId=74018</link><description>&lt;div style="line-height: normal;"&gt;&lt;blockquote style="border:solid .1em #ccc;font-style:italic;margin:.25em 1em 0 1em;padding:0 .25em 0 .25em"&gt;&lt;strong&gt;rivantsov wrote:&lt;/strong&gt;&lt;br&gt;
&lt;p style="padding-left:30px"&gt;&amp;quot;..Good point for FreeTextLiteral, although i still need to parse statements inside a macro... and it seems not possible (yet) to mix unstructured and structured lines in Irony? (at the condition that an unstructured line doesn't match a valid structured line...) &amp;quot;&lt;/p&gt;
&lt;p&gt;Well, for me the first problem is actually define formally how the macro body should be parsed; so far I don't have a clear picture honestly. Only after that we'll try to express these rules in Irony.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;My fault, you are right. Trying to quickly prototype without giving you a kind of &amp;quot;whole picture&amp;quot; and asking why is not working with Irony is not fair! Moreover, i'm discovering that the macro body is only parsed when expansion occurs. It means that you were right when you advise me to use FreeTextLiteral.&lt;/p&gt;
&lt;p&gt;ASM parsing is simple in many ways but assemblers have also a lots of weird syntax behaviour... instead of working on a MASM syntax, i should more probably develop an easier syntax to parse... i'll see that option too.&lt;/p&gt;
&lt;blockquote style="border:solid .1em #ccc;font-style:italic;margin:.25em 1em 0 1em;padding:0 .25em 0 .25em"&gt;&lt;strong&gt;rivantsov wrote:&lt;/strong&gt;&lt;br&gt;
&lt;p&gt;First of all Antlr is build on quite different algorithmic foundation, it uses top-down (LL) parser, while Irony follows bottom-up (LALR) algorithm. So out-of-the-box abilities of the algorithms are different. Generally, LALR algorithms are considered less restrictive, faster and overall preferable to LL. As one example,&amp;nbsp; LALR has not problem with Left-recursive rules, while LL cannot handle them at all, you have to refactor the grammar to get rid of these. As for using lookaheads, both approaches handle a single lookahead token as a facility of algorithm itself. Bigger lookaheads if needed are usually handled as custom code hooked into Parser that kicks in at point of indecision, looks ahead in token stream and gives parser an advice. There is such facility in Irony, look at c# sample. there is a custom lookahead code there that helps parser decide what is &amp;quot;&amp;lt;&amp;quot; in input - comparison operator or opening bracket for type parameter. In your case very similar code can do the same for looking up &amp;quot;macro&amp;quot; keyword in the stream.&lt;/p&gt;
&lt;p&gt;Anyway, good luck with your research, let me know if you need anything else&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Thanks! I missed the ResolveCode() in C# grammar. I have tested in the asm grammar and it's working great, even with unstructured token lines. So this ResolveCode() + On OnResolvingConflict() resolves the thing!&lt;/p&gt;
&lt;p&gt;About LALR(1) and the &amp;quot;one token ahead&amp;quot;, you are saying that &amp;quot;macro&amp;quot; in &amp;quot;Identifier + macro&amp;quot; is not considered as a one token ahead of &amp;quot;Identifier&amp;quot;? Or the token ahead is counting the current token? (sorry for this dummy question, I'm not played with parsing for a while!)&lt;/p&gt;
&lt;p&gt;The ResolveCode() + OnResolvingConflict() is really helpful and easy to use but i'm wondering if it would be relevant for Irony to provide a builtin simple disambiguation for one token ahead (or two, if the one token ahead is the current token)?&amp;nbsp; But ok, that's not a priority. Hope that you will be able to push a stable 1.0 before the end of the year.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>alexandre_mutel</author><pubDate>Wed, 11 Nov 2009 11:00:31 GMT</pubDate><guid isPermaLink="false">New Post: Macro expansion 20091111110031A</guid></item></channel></rss>