internal void ParseObject(Lines lines)
        {
            var match      = lines.FirstLineMustMatch(Patterns.ObjectSignature);
            var objectType = match.Groups [1].Value.ToEnum <ObjectType>();
            var objectID   = match.Groups [2].Value.ToInteger();
            var objectName = match.Groups [3].Value;

            Listener.OnBeginObject(objectType, objectID, objectName);

            lines.FirstLineMustMatch(Patterns.BeginObject);
            while (lines.LastLineTryMatch(Patterns.BlankLine))
            {
                ;
            }
            lines.LastLineMustMatch(Patterns.EndObject);

            // Because of the odd indentation of RDLData, we need to extract it
            // first (if present), so that the remaining lines follow the normal
            // section pattern.
            if (objectType == ObjectType.Report)
            {
                ParseRdlDataSection(lines);
            }

            lines.Unindent(2);

            foreach (var chunk in lines.Chunks(Patterns.SectionSignature))
            {
                ParseSection(chunk, objectType);
            }

            Listener.OnEndObject();
        }
Exemple #2
0
        internal bool ParseTrigger(Lines lines)
        {
            Match match;

            if (!lines.FirstLineTryMatch(Patterns.TriggerSignature, out match))
            {
                return(false);
            }

            lines.LastLineTryMatch(Patterns.BlankLine);

            var triggerName    = match.Groups [1].Value;
            var firstStatement = match.Groups [3].Value;

            Listener.OnBeginTrigger(triggerName);

            lines.Unindent(triggerName.Length + 1);

            if (firstStatement == "VAR")
            {
                ParseLocals(lines);
            }

            ParseCodeLines(lines);

            Listener.OnEndTrigger();

            return(true);
        }
        internal void ParseFormControlProperties(Lines lines)
        {
            lines.LastLineTryMatch(Patterns.BlankLine);
            lines.LastLineMustMatch(Patterns.EndPageControl);

            foreach (var chunk in lines.Chunks(Patterns.PropertySignature))
            {
                ParseProperty(chunk, true);
            }
        }
        internal void ParseCodeLines(Lines lines)
        {
            lines.LastLineTryMatch(Patterns.BlankLine);
            lines.FirstLineTryMatch(Patterns.BeginCodeBlock);
            lines.LastLineMustMatch(Patterns.EndCodeBlock);

            lines.Unindent(2);

            foreach (var line in lines)
            {
                Listener.OnCodeLine(line);
            }
        }