程序包 org.antlr.tool

类 Attribute


  • public class Attribute
    extends java.lang.Object
    Track the names of attributes define in arg lists, return values, scope blocks etc...
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      java.lang.String decl
      The entire declaration such as "String foo;"
      java.lang.String initValue
      The optional attribute intialization expression
      java.lang.String name
      The name of the attribute "foo"
      java.lang.String type
      The type; might be empty such as for Python which has no static typing
    • 构造器概要

      构造器 
      构造器 说明
      Attribute​(java.lang.String decl)  
      Attribute​(java.lang.String name, java.lang.String decl)  
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      protected void extractAttribute​(java.lang.String decl)
      For decls like "String foo" or "char *foo32[3]" compute the ID and type declarations.
      java.lang.String toString()  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 字段详细资料

      • decl

        public java.lang.String decl
        The entire declaration such as "String foo;"
      • type

        public java.lang.String type
        The type; might be empty such as for Python which has no static typing
      • name

        public java.lang.String name
        The name of the attribute "foo"
      • initValue

        public java.lang.String initValue
        The optional attribute intialization expression
    • 构造器详细资料

      • Attribute

        public Attribute​(java.lang.String decl)
      • Attribute

        public Attribute​(java.lang.String name,
                         java.lang.String decl)
    • 方法详细资料

      • extractAttribute

        protected void extractAttribute​(java.lang.String decl)
        For decls like "String foo" or "char *foo32[3]" compute the ID and type declarations. Also handle "int x=3" and 'T t = new T("foo")' but if the separator is ',' you cannot use ',' in the initvalue. AttributeScope.addAttributes takes care of the separation so we are free here to use from '=' to end of string as the expression. Set name, type, initvalue, and full decl instance vars.
      • toString

        public java.lang.String toString()
        覆盖:
        toString 在类中 java.lang.Object