KiCad PCB EDA Suite
TFIELD_T Namespace Reference

C++ does not put enum values in separate namespaces unless the enum itself is in a separate namespace. More...

Enumerations

enum  T {
  T_NONE = DSN_NONE, T_COMMENT = DSN_COMMENT, T_STRING_QUOTE = DSN_STRING_QUOTE, T_QUOTE_DEF = DSN_QUOTE_DEF,
  T_DASH = DSN_DASH, T_SYMBOL = DSN_SYMBOL, T_NUMBER = DSN_NUMBER, T_RIGHT = DSN_RIGHT,
  T_LEFT = DSN_LEFT, T_STRING = DSN_STRING, T_EOF = DSN_EOF, T_field = 0,
  T_name, T_templatefields, T_value, T_visible
}
 enum T contains all this lexer's tokens. More...
 

Detailed Description

C++ does not put enum values in separate namespaces unless the enum itself is in a separate namespace.

All the token enums must be in separate namespaces otherwise the C++ compiler will eventually complain if it sees more than one DSNLEXER in the same compilation unit, say by mutliple header file inclusion. Plus this also enables re-use of the same enum name T. A typedef can always be used to clarify which enum T is in play should that ever be a problem. This is unlikely since Parse() functions will usually only be exposed to one header file like this one. But if there is a problem, then use: typedef TFIELD_T::T T; within that problem area.

Enumeration Type Documentation

enum T contains all this lexer's tokens.

Enumerator
T_NONE 
T_COMMENT 
T_STRING_QUOTE 
T_QUOTE_DEF 
T_DASH 
T_SYMBOL 
T_NUMBER 
T_RIGHT 
T_LEFT 
T_STRING 
T_EOF 
T_field 
T_name 
T_templatefields 
T_value 
T_visible 

Definition at line 26 of file template_fieldnames_lexer.h.

27  {
28  // these first few are negative special ones for syntax, and are
29  // inherited from DSNLEXER.
30  T_NONE = DSN_NONE,
34  T_DASH = DSN_DASH,
37  T_RIGHT = DSN_RIGHT, // right bracket: ')'
38  T_LEFT = DSN_LEFT, // left bracket: '('
39  T_STRING = DSN_STRING, // a quoted string, stripped of the quotes
40  T_EOF = DSN_EOF, // special case for end of file
41 
42  T_field = 0,
43  T_name,
45  T_value,
46  T_visible
47  };