예제 #1
0
 public virtual void Visit(Designator designator)
 {
     VisitSubNodes(designator);
 }
예제 #2
0
 /// <summary>
 /// Set Designator tag
 /// </summary>
 /// <param name="tag">Tag to set</param>
 public void SetDesignator(Designator tag)
 {
     Tag = tag;
 }
예제 #3
0
        /// <summary>
        /// Parser for Designator
        /// </summary>
        /// <returns>Parsed Designator</returns>
        public Designator ParseDesignator()
        {
            Designator tag = new Designator();

            //Parse identifier of tag
            NextToken("identifier", "identifier");
            tag.SetIdentifier(CurrentToken.GetValue().ToString());

            while (TokenStream.HasNext())
            {   //Parse attributes
                if (TokenStream.Peek(1).GetType() == TokenType.SYMBOL && IsAttribute(TokenStream.Peek(1).GetValue().ToString()))
                {
                    tag.AddAttribute(ParseAttribute());
                }
                else
                {
                    break; //No attributes left, so break
                }
            }

            return tag;
        }