internal override int ParseMethod(ParsingSession session, out object result)
        {
            int succescode = 0;
            object unparsedIdentifier, dummy;
            CharacterParser leadingDot = new CharacterParser ('.');
            List<string> contextString = null;

            result = null;

            int bookmark = session.Offset;

            while (leadingDot.ParseMethod(session, out dummy) > 0) {
                if (contextString == null) {
                    contextString = new List<string>(session.Context.ToArray());
                    contextString.Reverse();
                }

                contextString.RemoveAt(contextString.Count - 1);
                succescode--;
            }

            string identifier = (contextString == null ? "" : string.Join(".", contextString.ToArray()) + ".");

            if (base.ParseMethod (session, out unparsedIdentifier) > 0) {
                identifier += unparsedIdentifier as String;

                if (session.References.Has (identifier)) {
                    result = session.References [identifier];
                    succescode = 1;
                } else {
                    session.Offset = bookmark;
                    if (succescode < 0)
                        throw new InvalidReferenceException (identifier);
                    else
                        succescode = -1;
                }
            }

            return succescode;
        }
 public DiamondFile(SettingsSyntax syntax)
 {
     this.opener  = new CharacterParser(syntax.AnonymousHeadOpener);
     this.closer = new CharacterParser(syntax.AnonymousHeadCloser);
     this.innerParser = new AnyStringParser ();
 }
 public void SetUp()
 {
     this.SUT = new CharacterParser ('a');
 }
 public AssignmentParser(char couplerChar = '=')
 {
     coupler = new CharacterParser(couplerChar);
 }
 public ConcatenationParser(char openerChar, char closerChar, char couplerChar)
 {
     this.opener = new CharacterParser (openerChar);
     this.closer = new CharacterParser (closerChar);
     this.coupler = new CharacterParser (couplerChar);
 }