KiCad PCB EDA Suite
BOM_CFG_READER_PARSER Class Reference

Class BOM_CFG_READER_PARSER holds data and functions pertinent to parsing a S-expression file for a WORKSHEET_LAYOUT. More...

Inheritance diagram for BOM_CFG_READER_PARSER:

Public Member Functions

 BOM_CFG_READER_PARSER (BOM_PLUGIN_ARRAY *aPlugins, const char *aData, const wxString &aSource)
 
void Parse ()
 

Private Member Functions

void parsePlugin ()
 

Private Attributes

BOM_PLUGIN_ARRAY * m_pluginsList
 

Detailed Description

Class BOM_CFG_READER_PARSER holds data and functions pertinent to parsing a S-expression file for a WORKSHEET_LAYOUT.

Definition at line 82 of file dialog_bom.cpp.

Constructor & Destructor Documentation

BOM_CFG_READER_PARSER::BOM_CFG_READER_PARSER ( BOM_PLUGIN_ARRAY *  aPlugins,
const char *  aData,
const wxString &  aSource 
)

Definition at line 97 of file dialog_bom.cpp.

References m_pluginsList.

99  :
100  DIALOG_BOM_CFG_LEXER( aLine, aSource )
101 {
102  m_pluginsList = aPlugins;
103 }
BOM_PLUGIN_ARRAY * m_pluginsList
Definition: dialog_bom.cpp:84

Member Function Documentation

void BOM_CFG_READER_PARSER::Parse ( )

Definition at line 106 of file dialog_bom.cpp.

References parsePlugin().

Referenced by DIALOG_BOM::installPluginsList().

107 {
108  T token;
109 
110  while( ( token = NextTok() ) != T_RIGHT )
111  {
112  if( token == T_EOF)
113  break;
114 
115  if( token == T_LEFT )
116  token = NextTok();
117 
118  if( token == T_plugins )
119  continue;
120 
121  switch( token )
122  {
123  case T_plugin: // Defines a new plugin
124  parsePlugin();
125  break;
126 
127  default:
128 // Unexpected( CurText() );
129  break;
130  }
131  }
132 }
void BOM_CFG_READER_PARSER::parsePlugin ( )
private

Definition at line 134 of file dialog_bom.cpp.

References BOM_PLUGIN::Command, m_pluginsList, BOM_PLUGIN::Name, and BOM_PLUGIN::Options.

Referenced by Parse().

135 {
136  BOM_PLUGIN plugin;
137 
138  NeedSYMBOLorNUMBER();
139  plugin.Name = FromUTF8();
140 
141  T token;
142  while( ( token = NextTok() ) != T_RIGHT )
143  {
144  if( token == T_EOF)
145  break;
146 
147  switch( token )
148  {
149  case T_LEFT:
150  break;
151 
152  case T_cmd:
153  NeedSYMBOLorNUMBER();
154  plugin.Command = FromUTF8();
155  NeedRIGHT();
156  break;
157 
158  case T_opts:
159  NeedSYMBOLorNUMBER();
160  plugin.Options.Add( FromUTF8() );
161  NeedRIGHT();
162  break;
163 
164  default:
165  Unexpected( CurText() );
166  break;
167  }
168  }
169 
170  if( ! plugin.Name.IsEmpty() )
171  m_pluginsList->Add( plugin );
172 }
wxArrayString Options
Definition: dialog_bom.cpp:67
Structure BOM_PLUGIN holds data of the BOM plugin.
Definition: dialog_bom.cpp:63
wxString Name
Definition: dialog_bom.cpp:65
BOM_PLUGIN_ARRAY * m_pluginsList
Definition: dialog_bom.cpp:84
wxString Command
Definition: dialog_bom.cpp:66

Member Data Documentation

BOM_PLUGIN_ARRAY* BOM_CFG_READER_PARSER::m_pluginsList
private

Definition at line 84 of file dialog_bom.cpp.

Referenced by BOM_CFG_READER_PARSER(), and parsePlugin().


The documentation for this class was generated from the following file: