Expecting number...?

Oct 6, 2015 at 1:39 PM
Hi, I'm trying to make a grammar for the language below:
# UI properties for Person Selection window

<Begin>

    # Images ---------------------------------------------------------------------------------------

    <DefineImage "BackgroundImage"                assetID="0x000003FA00000001"> #./uigraphics/personselection/person_select_background.bmp">
    <DefineImage "TabBackgroundImage"            assetID="0x000007CB00000001"> #./uigraphics/personselection/person_select_tabsback.bmp
    <DefineImage "DescriptionBackgroundImage"    assetID="0x000007BE00000001"> #./uigraphics/personselection/person_select_descriptionback.bmp    
    <DefineImage "DescriptionTabImage"            assetID="0x000007BF00000001"> #./uigraphics/personselection/person_select_descriptiontab.bmp
    <DefineImage "DescriptionTabBtnImage"        assetID="0x000007C000000001"> #./uigraphics/personselection/person_select_descriptiontabbtn.bmp
    <DefineImage "EnterTabBtnImage"                assetID="0x000007C100000001"> #./uigraphics/personselection/person_select_entertabbtn.bmp
    <DefineImage "EnterTabImage"                assetID="0x000007C400000001"> #./uigraphics/personselection/person_select_icontab.bmp
    <DefineImage "EnterTabIndentsImage"            assetID="0x000007C300000001"> #./uigraphics/personselection/person_select_iconsindents.bmp
    <DefineImage "ExitButtonImage"                assetID="0x000003FF00000001"> #./uigraphics/personselection/person_select_exitBtn.bmp">
    <DefineImage "SimCreateButtonImage"            assetID="0x000007C800000001"> #./uigraphics/personselection/person_select_simcreatebtn.bmp
    <DefineImage "SimSelectButtonImage"            assetID="0x000007C900000001"> #./uigraphics/personselection/person_select_simselectbtn.bmp
    <DefineImage "ScrollbarImage"                assetID="0x0000031000000001"> #./uigraphics/gizmo/gizmo_scrollbarimg.bmp
    <DefineImage "ScrollDownButtonImage"        assetID="0x000003F800000001"> #./uigraphics/personselection/person_select_arrowdownbtn.bmp
    <DefineImage "ScrollUpButtonImage"            assetID="0x000003F900000001"> #./uigraphics/personselection/person_select_arrowupbtn.bmp
    <DefineImage "HouseButtonTemplateImage"        assetID="0x000003DB00000001"> #./uigraphics/personselection/cas-sas-templatehouse.bmp
    <DefineImage "CityButtonTemplateImage"        assetID="0x000003DA00000001"> #./uigraphics/personselection/cas-sas-templatecity.bmp
    <DefineImage "CityHouseButtonAlpha"            assetID="0x0000017900000002"> #./uigraphics/personselection/person_select_cityhouseiconalpha.tga
    <DefineImage "DefaultHouseImage"            assetID="0x000004CC00000001">
    <DefineImage "CreditsButtonImage"            assetID="0x0000089500000001"> #./uigraphics/personselection/cas-sas-creditsbtn.bmp
    <DefineImage "CreditsBackgroundImage"        assetID="0x0000089600000001"> #./uigraphics/personselection/cas-sas-creditsindent.bmp    
    <DefineImage "CityThumbnailBusyImage"        assetID="0x00000B8200000001"> #./uigraphics/personselection/person_select_cityhouseiconbusy.tga

    # Strings --------------------------------------------------------------------------------------

    <Begin><SetSharedProperties stringDir = "UIText" stringTable = 169>

My grammar looks like:
using System;
using System.Collections.Generic;
using System.Text;
using Irony.Parsing;
using Irony.Ast;

namespace UIParser
{
[Language("TSO UIScript", "1.0", "TSO UIScript parser")]
public class UIGrammar : Grammar
{
    public UIGrammar()
    {
        StringLiteral STRING = new StringLiteral("STRING", "\"", StringOptions.None);
        NumberLiteral NUMBER = new NumberLiteral("NUMBER", NumberOptions.None);
        //NUMBER.DecimalSeparator = '.';
        NUMBER.AddPrefix("(", NumberOptions.IntOnly);
        NUMBER.AddSuffix(")");
        //ints that are too long for int32 are converted to int64
        NUMBER.DefaultIntTypes = new TypeCode[] { TypeCode.Int32, TypeCode.Int64 };

        CommentTerminal LINE_COMMENT = new CommentTerminal("LINE_COMMENT", "#", "\n", "\r\n");
        NonGrammarTerminals.Add(LINE_COMMENT);

        NonTerminal BEGIN = new NonTerminal("BEGIN");
        NonTerminal START_STATEMENT = new NonTerminal("START_STATEMENT");                     //< LINE_CONTENT >
        NonTerminal LINE_CONTENT = new NonTerminal("LINE_CONTENT");                           //Any of the below.
        NonTerminal BEGIN_STATEMENT = new NonTerminal("BEGIN_STATEMENT");                     //<
        NonTerminal DEFINEIMAGE_STATEMENT = new NonTerminal("DEFINEIMAGE_STATEMENT");         //<Begin>
        NonTerminal DEFINESTRING_STATEMENT = new NonTerminal("DEFINESTRING_STATEMENT");       //<DefineString>
        NonTerminal SETSHAREDPROPS_STATEMENT = new NonTerminal("SETSHAREDPROPS_STATEMENT");   
        NonTerminal SETSHAREDPROPS = new NonTerminal("SETSHAREDPROPS");                       //<SetSharedProperties>
        NonTerminal SHAREDPROPS_ARG = new NonTerminal("SHAREDPROPS_ARG");                     //stringDir, leftArrowImage, trigger
        NonTerminal SETCONTROLPROPS_STATEMENT = new NonTerminal("SETCONTROLPROPS_STATEMENT"); 
        NonTerminal SETCONTROLPROPS = new NonTerminal("SETCONTROLPROPS");                     //<SetControlProperties>
        NonTerminal CONTROLPROPS_ARG = new NonTerminal("CONTROLPROPS_ARG1");                 //image
        NonTerminal END_STATEMENT = new NonTerminal("END_STATEMENT");                         //>
        NonTerminal ARRAY = new NonTerminal("ARRAY");                                         //(1,2,3,4)
        NonTerminal ARRAYNUMBER = new NonTerminal("ARRAYNUMBER");                             //1, 2, 3, 4
        NonTerminal END_IDENTIFIER = new NonTerminal("END_IDENTIFIER");                       //<End>

        IdentifierTerminal STRINGDIR = new IdentifierTerminal("STRINGDIR"),
            STRINGTABLE = new IdentifierTerminal("STRINGTABLE"),
            LEFTARROWIMAGE = new IdentifierTerminal("LEFTARROWIMAGE"),
            RIGHTARROWIMAGE = new IdentifierTerminal("RIGHTARROWIMAGE"),
            TRACKING = new IdentifierTerminal("TRACKING"),
            TRIGGER = new IdentifierTerminal("TRIGGER"),
            IMAGE = new IdentifierTerminal("IMAGE"),
            POSITION = new IdentifierTerminal("POSITION"),
            SIZE = new IdentifierTerminal("SIZE");
        STRINGDIR.AddPrefix("stringDir", IdOptions.None);
        STRINGTABLE.AddPrefix("stringTable", IdOptions.None);
        LEFTARROWIMAGE.AddPrefix("leftArrowImage", IdOptions.None);
        RIGHTARROWIMAGE.AddPrefix("rightArrowImage", IdOptions.None);
        TRACKING.AddPrefix("tracking", IdOptions.None);
        TRIGGER.AddPrefix("trigger", IdOptions.None);
        IMAGE.AddPrefix("image", IdOptions.None);
        POSITION.AddPrefix("position", IdOptions.None);
        SIZE.AddPrefix("size", IdOptions.None);

        KeyTerm COMMA = new KeyTerm(",", "COMMA");

        //Rules
        START_STATEMENT.Rule = Empty | "<" + LINE_CONTENT + END_STATEMENT;
        LINE_CONTENT.Rule = Empty | BEGIN_STATEMENT | DEFINEIMAGE_STATEMENT | SETSHAREDPROPS_STATEMENT | 
            SETCONTROLPROPS_STATEMENT | DEFINESTRING_STATEMENT | END_IDENTIFIER;
        BEGIN_STATEMENT.Rule = "Begin";
        DEFINEIMAGE_STATEMENT.Rule = "DefineImage" + STRING + "assetID" + "=" + STRING;
        DEFINESTRING_STATEMENT.Rule = "DefineString" + STRING + "stringIndex" + "=" + NUMBER;

        SETSHAREDPROPS_STATEMENT.Rule = MakePlusRule(SETSHAREDPROPS, SHAREDPROPS_ARG);
        SETSHAREDPROPS.Rule = "SetSharedProperties";
        SHAREDPROPS_ARG.Rule = STRINGDIR + "=" + STRING | LEFTARROWIMAGE + "=" + STRING  | TRACKING + "=" + NUMBER | 
            IMAGE + "=" + STRING | STRINGTABLE + "=" + NUMBER | RIGHTARROWIMAGE + "=" + STRING | TRIGGER + "=" + NUMBER;

        SETCONTROLPROPS_STATEMENT.Rule = MakePlusRule(SETCONTROLPROPS, CONTROLPROPS_ARG);
        SETCONTROLPROPS.Rule = "SetControlProperties";
        CONTROLPROPS_ARG.Rule = IMAGE + "=" + STRING | POSITION + "=" + ARRAY | SIZE + "=" + ARRAY;

        ARRAY.Rule = MakePlusRule(ARRAYNUMBER, COMMA, NUMBER);
        ARRAYNUMBER.Rule = NUMBER;

        END_STATEMENT.Rule = ">";
        END_IDENTIFIER.Rule = "End";
        BEGIN.Rule = MakePlusRule(BEGIN, START_STATEMENT);

        this.Root = BEGIN;
    }
}
}

``` The Grammar Explorer gets to SetSharedProperties, expecting a NUMBER after stringDir. Why?
Coordinator
Oct 7, 2015 at 4:24 AM
hi
first question - does grammar explorer show any conflicts? if yes, fix them. Then if you have no conflicts, and parser stumbles at some state, go inspect productions in this state and see what's missing - from state productions you can usually get the picture of what's going on
hope this helps
Oct 24, 2015 at 3:48 PM
Thanks for your reply!
I managed to get the parser to parse, and I even generated an AST. But I discovered that both "tooltip" and "toolTip" are being used in my language, and so I tried to encompass that in my grammar. But it crashes the GrammarExplorer :( The same thing happens when I try to set caseSensitive to false.
Here's my current grammar:
using System;
using System.Collections.Generic;
using System.Text;
using Irony.Interpreter.Ast;
using UIParser.Nodes;
using Irony.Parsing;
using Irony.Ast;

namespace UIParser
{
    [Language("TSO UIScript", "1.0", "TSO UIScript parser")]
    public class UIGrammar : Grammar
    {
        public UIGrammar() : base(/*caseSensitive: false*/)
        {
            LanguageFlags = LanguageFlags.CreateAst;

            StringLiteral STRING = new StringLiteral("STRING", "\"", StringOptions.None);
            NumberLiteral NUMBER = new NumberLiteral("NUMBER", NumberOptions.None);
            //ints that are too long for int32 are converted to int64
            NUMBER.DefaultIntTypes = new TypeCode[] { TypeCode.Int32, TypeCode.Int64 };

            STRING.AstConfig.NodeType = typeof(StringValueNode);
            NUMBER.AstConfig.NodeType = typeof(NumberValueNode);

            CommentTerminal LINE_COMMENT = new CommentTerminal("LINE_COMMENT", "#", "\n", "\r\n");
            NonGrammarTerminals.Add(LINE_COMMENT);

            NonTerminal BEGIN = new NonTerminal("BEGIN", typeof(BeginNode));
            NonTerminal START_STATEMENT = new NonTerminal("START_STATEMENT", typeof(StartStatementNode));                      //< LINE_CONTENT >
            NonTerminal LINE_CONTENT = new NonTerminal("LINE_CONTENT", typeof(LineContentNode));                               //Any of the below.
            NonTerminal BEGIN_STATEMENT = new NonTerminal("BEGIN_STATEMENT", typeof(BeginStatementNode));                      //<Begin>
            NonTerminal ASSIGNMENT = new NonTerminal("ASSIGNMENT", typeof(UIParser.Nodes.AssignmentNode));                     //Argument = STRING | NUMBER
            NonTerminal ASSIGNMENTBLOCK = new NonTerminal("ASSIGNMENTBLOCK", typeof(AssignmentBlockNode));
            NonTerminal DEFINEIMAGE_STATEMENT = new NonTerminal("DEFINEIMAGE_STATEMENT", typeof(DefineImageNode));             //<DefineImage>
            NonTerminal DEFINESTRING_STATEMENT = new NonTerminal("DEFINESTRING_STATEMENT", typeof(DefineStringNode));          //<DefineString>
            NonTerminal SETSHAREDPROPS_STATEMENT = new NonTerminal("SETSHAREDPROPS_STATEMENT", typeof(SetSharedPropsNode));    //<SetSharedProperties>
            NonTerminal ADDBUTTON_STATEMENT = new NonTerminal("ADDBUTTON_STATEMENT", typeof(AddButtonNode));                   //<AddButton>
            NonTerminal ADDTEXT_STATEMENT = new NonTerminal("ADDTEXT_STATEMENT", typeof(AddTextNode));                         //<AddText>         
            NonTerminal ADDTEXTEDIT_STATEMENT = new NonTerminal("ADDTEXTEDIT_STATEMENT", typeof(AddTextEditNode));             //<AddTextEdit>
            NonTerminal ADDSLIDER_STATEMENT = new NonTerminal("ADDSLIDER_STATEMENT", typeof(AddSliderNode));                   //<AddSlider>
            NonTerminal ADDPROGRESSBAR_STATEMENT = new NonTerminal("ADDPROGRESSBAR_STATEMENT", typeof(AddProgressBarNode));    //<AddProgressBar>     
            NonTerminal ADDLISTBOX_STATEMENT = new NonTerminal("ADDLISTBOX_STATEMENT", typeof(AddListboxNode));                //<AddListBox>      
            NonTerminal ADDFORMATEDTEXT_STATEMENT = new NonTerminal("ADDFORMATEDTEXT", typeof(AddFormatedTextNode));           //<AddFormattedText>
            NonTerminal SETCONTROLPROPS_STATEMENT = new NonTerminal("SETCONTROLPROPS_STATEMENT", typeof(SetControlPropsNode)); //<SetControlProperties>                    
            NonTerminal ARRAY = new NonTerminal("ARRAY", typeof(ArrayNode));
            NonTerminal ARRAYLIST = new NonTerminal("ARRAYLIST", typeof(ArrayListNode));                                       //(1,2,3,4)

            NonTerminal END_IDENTIFIER = new NonTerminal("END_IDENTIFIER", typeof(EndNode));                                   //<End>

            KeyTerm COMMA = new KeyTerm(",", "COMMA");
            COMMA.AstConfig.NodeType = typeof(CommaNode);

            //Rules
            START_STATEMENT.Rule = Empty | ToTerm("<") + LINE_CONTENT + ToTerm(">");
            LINE_CONTENT.Rule = Empty | BEGIN_STATEMENT | DEFINEIMAGE_STATEMENT | SETSHAREDPROPS_STATEMENT | 
                SETCONTROLPROPS_STATEMENT | ADDBUTTON_STATEMENT | ADDTEXT_STATEMENT | ADDTEXTEDIT_STATEMENT | 
                ADDSLIDER_STATEMENT | ADDPROGRESSBAR_STATEMENT | ADDLISTBOX_STATEMENT | ADDFORMATEDTEXT_STATEMENT | 
                DEFINESTRING_STATEMENT | END_IDENTIFIER;
            BEGIN_STATEMENT.Rule = "Begin";
            DEFINEIMAGE_STATEMENT.Rule = ToTerm("DefineImage") + STRING + ASSIGNMENTBLOCK;
            DEFINESTRING_STATEMENT.Rule = ToTerm("DefineString") + STRING + ASSIGNMENTBLOCK;

            ASSIGNMENT.Rule = ToTerm("stringDir") + ToTerm("=") + STRING | ToTerm("stringTable") + ToTerm("=") + NUMBER |
                ToTerm("leftArrowImage") + ToTerm("=") + STRING | ToTerm("rightArrowImage") + ToTerm("=") + STRING |
                ToTerm("tracking") + ToTerm("=") + NUMBER | ToTerm("trigger") + ToTerm("=") + NUMBER |
                ToTerm("image") + ToTerm("=") + STRING | ToTerm("position") + ToTerm("=") + ARRAY |
                ToTerm("size") + ToTerm("=") + ARRAY | ToTerm("tooltip") + ToTerm("=") + STRING |
                ToTerm("toolTip") + ToTerm("=") + STRING | ToTerm("id") + ToTerm("=") + NUMBER | 
                ToTerm("orientation") + ToTerm("=") + NUMBER | ToTerm("opaque") + ToTerm("=") + NUMBER | 
                ToTerm("assetID") + ToTerm("=") + STRING |ToTerm("stringIndex") + ToTerm("=") + NUMBER | 
                ToTerm("text") + ToTerm("=") + STRING | ToTerm("font") + ToTerm("=") + NUMBER | 
                ToTerm("textColor") + ToTerm("=") + ARRAY | ToTerm("textColorSelected") + ToTerm("=") + ARRAY | 
                ToTerm("textColorHighlighted") + ToTerm("=") + ARRAY | ToTerm("textColorDisabled") + ToTerm("=") + ARRAY | 
                ToTerm("textButton") + ToTerm("=") + NUMBER | ToTerm("color") + ToTerm("=") + ARRAY | 
                ToTerm("alignment") + ToTerm("=") + NUMBER | ToTerm("backColor") + ToTerm("=") + ARRAY | 
                ToTerm("frameOnFocus") + ToTerm("=") + NUMBER | ToTerm("cursorColor") + ToTerm("=") + ARRAY | 
                ToTerm("transparent") + ToTerm("=") + NUMBER | ToTerm("frameColor") + ToTerm("=") + ARRAY | 
                ToTerm("capacity") + ToTerm("=") + NUMBER | ToTerm("lines") + ToTerm("=") + NUMBER | 
                ToTerm("flashOnEmpty") + ToTerm("=") + NUMBER | ToTerm("thumbSize") + ToTerm("=") + ARRAY | 
                ToTerm("thumbMargins") + ToTerm("=") + ARRAY | ToTerm("thumbImageSize") + ToTerm("=") + ARRAY | 
                ToTerm("thumbImageOffsets") + ToTerm("=") + ARRAY | ToTerm("thumbButtonImage") + ToTerm("=") + STRING | 
                ToTerm("wrapped") + ToTerm("=") + NUMBER | ToTerm("textColor") + ToTerm("=") + ARRAY |  
                ToTerm("mode") + ToTerm("=") + STRING | ToTerm("scrollBarImage") + ToTerm("=") + STRING | 
                ToTerm("scrollBarGutter") + ToTerm("=") + NUMBER | ToTerm("scrollBarType") + ToTerm("=") + NUMBER | 
                ToTerm("enableIME") + ToTerm("=") + NUMBER | ToTerm("highlighted") + ToTerm("=") + NUMBER | 
                ToTerm("minValue") + ToTerm("=") + NUMBER | ToTerm("maxValue") + ToTerm("=") + NUMBER | 
                ToTerm("pageSize") + ToTerm("=") + NUMBER;
            //This means "assignmentblock is assignment followed by n assignments". 
            ASSIGNMENTBLOCK.Rule = MakePlusRule(ASSIGNMENTBLOCK, ASSIGNMENT);

            SETSHAREDPROPS_STATEMENT.Rule = ToTerm("SetSharedProperties") + ASSIGNMENTBLOCK;
            SETCONTROLPROPS_STATEMENT.Rule = ToTerm("SetControlProperties") + STRING + ASSIGNMENTBLOCK | 
                ToTerm("SetControlProperties") + STRING;

            ADDBUTTON_STATEMENT.Rule = ToTerm("AddButton") + STRING + ASSIGNMENTBLOCK;
            ADDTEXT_STATEMENT.Rule = ToTerm("AddText") + STRING + ASSIGNMENTBLOCK;
            ADDTEXTEDIT_STATEMENT.Rule = ToTerm("AddTextEdit") + STRING + ASSIGNMENTBLOCK;
            ADDSLIDER_STATEMENT.Rule = ToTerm("AddSlider") + STRING + ASSIGNMENTBLOCK;
            ADDPROGRESSBAR_STATEMENT.Rule = ToTerm("AddProgressBar") + STRING + ASSIGNMENTBLOCK;
            ADDLISTBOX_STATEMENT.Rule = ToTerm("AddListBox") + STRING + ASSIGNMENTBLOCK;
            ADDFORMATEDTEXT_STATEMENT.Rule = ToTerm("AddFormatedText") + STRING + ASSIGNMENTBLOCK;

            ARRAY.Rule = ToTerm("(") + ARRAYLIST + ")";
            ARRAYLIST.Rule = MakeStarRule(ARRAYLIST, COMMA, NUMBER);

            END_IDENTIFIER.Rule = "End";
            BEGIN.Rule = MakePlusRule(BEGIN, START_STATEMENT);

            this.Root = BEGIN;
        }
    }
}
Oct 24, 2015 at 3:50 PM
Here's the exception thrown by GrammarExplorer:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at UIParser.Nodes.AddButtonNode.InitChildren(ParseTreeNodeList nodes)
   at UIParser.Nodes.UINode.Init(AstContext context, ParseTreeNode treeNode)
   at Irony.Ast.AstBuilder.BuildAst(ParseTreeNode parseNode) in C:\Users\Afr0\Documents\GitHub\Project-Dollhouse\Other\libs\UIParser\UIParser\Irony_2013_12_12\Irony\Ast\AstBuilder.cs:line 101
   at Irony.Ast.AstBuilder.BuildAst(ParseTreeNode parseNode) in C:\Users\Afr0\Documents\GitHub\Project-Dollhouse\Other\libs\UIParser\UIParser\Irony_2013_12_12\Irony\Ast\AstBuilder.cs:line 86
   at Irony.Ast.AstBuilder.BuildAst(ParseTreeNode parseNode) in C:\Users\Afr0\Documents\GitHub\Project-Dollhouse\Other\libs\UIParser\UIParser\Irony_2013_12_12\Irony\Ast\AstBuilder.cs:line 86
   at Irony.Ast.AstBuilder.BuildAst(ParseTreeNode parseNode) in C:\Users\Afr0\Documents\GitHub\Project-Dollhouse\Other\libs\UIParser\UIParser\Irony_2013_12_12\Irony\Ast\AstBuilder.cs:line 86
   at Irony.Ast.AstBuilder.BuildAst(ParseTree parseTree) in C:\Users\Afr0\Documents\GitHub\Project-Dollhouse\Other\libs\UIParser\UIParser\Irony_2013_12_12\Irony\Ast\AstBuilder.cs:line 38
   at Irony.Parsing.Grammar.BuildAst(LanguageData language, ParseTree parseTree) in C:\Users\Afr0\Documents\GitHub\Project-Dollhouse\Other\libs\UIParser\UIParser\Irony_2013_12_12\Irony\Parsing\Grammar\Grammar.cs:line 500
   at Irony.Parsing.Parser.Parse(String sourceText, String fileName) in C:\Users\Afr0\Documents\GitHub\Project-Dollhouse\Other\libs\UIParser\UIParser\Irony_2013_12_12\Irony\Parsing\Parser\Parser.cs:line 88
   at Irony.GrammarExplorer.fmGrammarExplorer.ParseSample() in C:\Users\Afr0\Documents\GitHub\Project-Dollhouse\Other\libs\UIParser\UIParser\Irony_2013_12_12\Irony.GrammarExplorer\fmGrammarExplorer.cs:line 348
   at Irony.GrammarExplorer.fmGrammarExplorer.btnParse_Click(Object sender, EventArgs e) in C:\Users\Afr0\Documents\GitHub\Project-Dollhouse\Other\libs\UIParser\UIParser\Irony_2013_12_12\Irony.GrammarExplorer\fmGrammarExplorer.cs:line 507
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Here's the conflict:
State S172 (Inadequate)
  Reduce-reduce conflicts on inputs: stringDir stringTable leftArrowImage rightArrowImage tracking trigger image position size tooltip toolTip id orientation opaque assetID stringIndex text font textColor textColorSelected textColorHighlighted textColorDisabled textButton color alignment backColor frameOnFocus cursorColor transparent frameColor capacity lines flashOnEmpty thumbSize thumbMargins thumbImageSize thumbImageOffsets thumbButtonImage wrapped mode scrollBarImage scrollBarGutter scrollBarType enableIME highlighted minValue maxValue pageSize >
  Reduce items:
    ASSIGNMENT -> textColor = ARRAY · [stringDir stringTable leftArrowImage rightArrowImage tracking trigger image position size tooltip toolTip id orientation opaque assetID stringIndex text font textColor textColorSelected textColorHighlighted textColorDisabled textButton color alignment backColor frameOnFocus cursorColor transparent frameColor capacity lines flashOnEmpty thumbSize thumbMargins thumbImageSize thumbImageOffsets thumbButtonImage wrapped mode scrollBarImage scrollBarGutter scrollBarType enableIME highlighted minValue maxValue pageSize >]
    ASSIGNMENT -> textColor = ARRAY · [stringDir stringTable leftArrowImage rightArrowImage tracking trigger image position size tooltip toolTip id orientation opaque assetID stringIndex text font textColor textColorSelected textColorHighlighted textColorDisabled textButton color alignment backColor frameOnFocus cursorColor transparent frameColor capacity lines flashOnEmpty thumbSize thumbMargins thumbImageSize thumbImageOffsets thumbButtonImage wrapped mode scrollBarImage scrollBarGutter scrollBarType enableIME highlighted minValue maxValue pageSize >]
  Transitions: 
Oct 24, 2015 at 4:03 PM
Here's the file I was testing on:
# UI properties for Person Edit view window

<Begin>

    # Images --------------------------------------------------------------------------------------

    <DefineImage "BackgroundImage"              assetID="0x000003DC00000001"> #./uigraphics/personSelection\person_edit_background.bmp
    <DefineImage "LeftArrowImage"               assetID="0x000003F500000001"> #./uigraphics/personSelection\person_edit_skinBrowserArrowLeft.bmp
    <DefineImage "RightArrowImage"              assetID="0x000003F600000001"> #./uigraphics/personSelection\person_edit_skinBrowserArrowRight.bmp
    <DefineImage "BodySkinButtonImage"          assetID="0x000003DF00000001"> #./uigraphics/personSelection\person_edit_bodySkinBtn.bmp
    <DefineImage "HeadSkinButtonImage"          assetID="0x000003E600000001"> #./uigraphics/personSelection\person_edit_headSkinBtn.bmp
    <DefineImage "CancelButtonImage"            assetID="0x000003E000000001"> #./uigraphics/personSelection\person_edit_cancelBtn.bmp
    <DefineImage "FemaleButtonImage"            assetID="0x000003E400000001"> #./uigraphics/personSelection\person_edit_femaleBtn.bmp
    <DefineImage "MaleButtonImage"              assetID="0x000003EB00000001"> #./uigraphics/personSelection\person_edit_maleBtn.bmp
    <DefineImage "AcceptButtonImage"            assetID="0x0000081C00000001"> #./uigraphics/personselection/person_edit_acceptbtn.bmp
    <DefineImage "ExitButtonImage"              assetID="0x0000081D00000001"> #./uigraphics/personselection/person_edit_closebtn.bmp
    <DefineImage "SkinDarkButtonImage"          assetID="0x0000081E00000001"> #./uigraphics/personselection/person_edit_skindarkbtn.bmp
    <DefineImage "SkinLightButtonImage"         assetID="0x0000081F00000001"> #./uigraphics/personselection/person_edit_skinlightbtn.bmp
    <DefineImage "SkinMediumButtonImage"        assetID="0x0000082000000001"> #./uigraphics/personselection/person_edit_skinmediumbtn.bmp
    <DefineImage "ScrollbarImage"               assetID="0x000003E200000001"> #./uigraphics/personselection/person_edit_descriptionslider.bmp
    <DefineImage "ScrollDownButtonImage"        assetID="0x0000082100000001"> #./uigraphics/personselection/person_edit_arrowdownbtn.bmp
    <DefineImage "ScrollUpButtonImage"          assetID="0x0000082200000001"> #./uigraphics/personselection/person_edit_arrowupbtn.bmp

    # Strings --------------------------------------------------------------------------------------

    <Begin><SetSharedProperties stringDir = "UIText" stringTable = 170>

        <DefineString "CancelButtonTooltip"                     stringIndex = 1>
        <DefineString "AcceptButtonTooltip"                     stringIndex = 2>
        <DefineString "NameTooltip"                             stringIndex = 3>
        <DefineString "DescriptionTooltip"                      stringIndex = 4>
        <DefineString "ExitButtonTooltip"                       stringIndex = 5>
        <DefineString "FemaleButtonTooltip"                     stringIndex = 6>
        <DefineString "MaleButtonTooltip"                       stringIndex = 7>
        <DefineString "SkinLightButtonTooltip"                  stringIndex = 8>
        <DefineString "SkinMediumButtonTooltip"                 stringIndex = 9>
        <DefineString "SkinDarkButtonTooltip"                   stringIndex = 10>
        <DefineString "InvalidNameErrorTitle"                   stringIndex = 11>
        <DefineString "InvalidNameErrorShort"                   stringIndex = 12>
        <DefineString "InvalidNameErrorLong"                    stringIndex = 13>
        <DefineString "InvalidNameErrorNumeric"                 stringIndex = 14>
        <DefineString "InvalidNameErrorApostrophe"              stringIndex = 15>
        <DefineString "InvalidNameErrorDash"                    stringIndex = 16>
        <DefineString "InvalidNameErrorSpace"                   stringIndex = 17>
        <DefineString "InvalidNameErrorSpecial"                 stringIndex = 18>
        <DefineString "InvalidNameErrorCensor"                  stringIndex = 19>
        <DefineString "ScrollUpTooltip"                         stringIndex = 20>
        <DefineString "ScrollDownTooltip"                       stringIndex = 21>
        <DefineString "TitleLabelText"                          stringIndex = 22>
        <DefineString "DefaultAvatarDescription"                stringIndex = 23>
        <DefineString "ProgressDialogTitle"                     stringIndex = 24>
        <DefineString "ProgressDialogMessage"                   stringIndex = 25>

    <End>

    # Controls -------------------------------------------------------------------------------------    

    <AddButton "CancelButton" id=1 image="CancelButtonImage"  position=(743,58)  tooltip="CancelButtonTooltip">
    <AddButton "AcceptButton" id=2 image="AcceptButtonImage"  position=(743,114) tooltip="AcceptButtonTooltip">

    <AddTextEdit "NameTextEdit" 

                id = 3
    
                position        = (22,52)  
                size            = (230,18) 
                font            = 9 
                lines           = 1
                capacity        = 24
                frameOnFocus    = 0
                color           = (255,249,157) 
                backColor       = (0,0,0)
                cursorColor     = (255,255,255)
                frameColor      = (255,249,157)
                transparent     = 1
                alignment       = 3
                flashOnEmpty    = 1

                toolTip = "NameTooltip"
    >   

    <AddTextEdit "DescriptionTextEdit" 

                id = 4
    
                position        = (33,364)  
                size            = (194,195) 
                font            = 9 
                lines           = 10
                capacity        = 499
                frameOnFocus    = 0
                color           = (255,249,157) 
                backColor       = (0,0,0)
                cursorColor     = (255,255,255)
                frameColor      = (255,249,157)
                transparent     = 1

                toolTip = "DescriptionTooltip"
    >   

    <AddSlider "DescriptionSlider"              id = 5 image = "ScrollbarImage"         position=(244,370) size=(10,182) orientation=1 >
    <AddButton "DescriptionScrollUpButton"      id = 6 image = "ScrollUpButtonImage"    position=(240,360)  tooltip="ScrollUpTooltip">
    <AddButton "DescriptionScrollDownButton"    id = 7 image = "ScrollDownButtonImage"  position=(241,557)  tooltip="ScrollDownTooltip">

    <AddButton "ExitButton" id=8 position=(762,8) image="ExitButtonImage" tooltip="ExitButtonTooltip">

    # body buttons

    <Begin><SetSharedProperties tracking=1 trigger=1>
    
        <AddButton "FemaleButton"       id=9  image="FemaleButtonImage"     position=(292,142) tooltip="FemaleButtonTooltip">
        <AddButton "MaleButton"         id=10 image="MaleButtonImage"       position=(292,198) tooltip="MaleButtonTooltip">
        <AddButton "SkinLightButton"    id=11 image="SkinLightButtonImage"  position=(294,271) tooltip="SkinLightButtonTooltip">
        <AddButton "SkinMediumButton"   id=12 image="SkinMediumButtonImage" position=(294,321) tooltip="SkinMediumButtonTooltip">
        <AddButton "SkinDarkButton"     id=13 image="SkinDarkButtonImage"   position=(294,372) tooltip="SkinDarkButtonTooltip">

    <End>

    # skin browsers

    <Begin><SetSharedProperties leftArrowImage="LeftArrowImage" rightArrowImage="RightArrowImage" >

        <SetControlProperties "HeadSkinBrowser" 
            
            position            =   (378,77)
            size                =   (326,210)
            thumbSize           =   (39,44)
            thumbMargins        =   (6,8)
            thumbImageSize      =   (33,33)
            thumbImageOffsets   =   (2,2)
            thumbButtonImage    =   "HeadSkinButtonImage"
        >
        
        <SetControlProperties "BodySkinBrowser"
        
            position            =   (370,348)
            size                =   (366,220)
            thumbSize           =   (39,78)
            thumbMargins        =   (6,6)
            thumbImageSize      =   (33,70)
            thumbImageOffsets   =   (2,2)
            thumbButtonImage    =   "BodySkinButtonImage"
        >

    <End>

    # Person 3d VitaBoy view ----------------------------------------------------------------------

    <SetControlProperties "Person3dView" position=(70,88) size=(140,200)>

    # Title Text ------------------------------------------------------------------------------------------------------------

    <AddText "TitleLabel" id=14 position=(100,11) size=(620,20) font=12 color=(255,249,157) alignment=3 opaque=0 text="TitleLabelText">
    
<End>