예제 #1
0
        private PropertyTemplate  parse0()
        {
            var parameterNode = new PropertyTemplate();

            parameterNode.IsPropertyTemplates = true;

            parameterNode.Name = parsePropertyName();

            if (_reader.HasNext())
            {
                parameterNode.SubTemplates = parseParameter();
            }

            return(parameterNode);
        }
예제 #2
0
        private Dictionary <string, PropertyTemplate> parseParameter()
        {
            var dic = new Dictionary <string, PropertyTemplate>();

            while (true)
            {
                var key = parseKey();

                throwIfHasNoNextOrNext();

                if (_reader.Current() == '@' && _reader.HasNext() && _reader.Forwards() == '{')
                {
                    _reader.Next();
                    dic.Add(key, parse());

                    throwIfHasNoNextOrNext();

                    if (_reader.Current() == ']')
                    {
                        return(dic);
                    }
                    else
                    {
                        throwIfNotMatch(',', "require char ','");
                    }
                }
                else
                {
                    _reader.Back();

                    var parameterNode = new PropertyTemplate();

                    parameterNode.Value = parseSegment(',', ']');

                    dic.Add(key, parameterNode);

                    if (_reader.Current() == ']')
                    {
                        return(dic);
                    }
                    else
                    {
                        throwIfNotMatch(',', "require char ','");
                    }
                }
            }
        }