KiCad PCB EDA Suite
BOM_CFG_PARSER Class Reference

Holds data and functions pertinent to parsing a S-expression file. More...

Inheritance diagram for BOM_CFG_PARSER:

Public Member Functions

 BOM_CFG_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

Holds data and functions pertinent to parsing a S-expression file.

Definition at line 80 of file dialog_bom.cpp.

Constructor & Destructor Documentation

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

Definition at line 93 of file dialog_bom.cpp.

References m_pluginsList.

94  :
95  DIALOG_BOM_CFG_LEXER( aLine, aSource )
96 {
97  m_pluginsList = aPlugins;
98 }
BOM_PLUGIN_ARRAY * m_pluginsList
Definition: dialog_bom.cpp:82

Member Function Documentation

void BOM_CFG_PARSER::Parse ( )

Definition at line 101 of file dialog_bom.cpp.

References parsePlugin().

Referenced by DIALOG_BOM::installPluginsList().

102 {
103  T token;
104 
105  while( ( token = NextTok() ) != T_RIGHT )
106  {
107  if( token == T_EOF)
108  break;
109 
110  if( token == T_LEFT )
111  token = NextTok();
112 
113  if( token == T_plugins )
114  continue;
115 
116  switch( token )
117  {
118  case T_plugin: // Defines a new plugin
119  parsePlugin();
120  break;
121 
122  default:
123 // Unexpected( CurText() );
124  break;
125  }
126  }
127 }
void parsePlugin()
Definition: dialog_bom.cpp:130
void BOM_CFG_PARSER::parsePlugin ( )
private

Definition at line 130 of file dialog_bom.cpp.

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

Referenced by Parse().

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

Member Data Documentation

BOM_PLUGIN_ARRAY* BOM_CFG_PARSER::m_pluginsList
private

Definition at line 82 of file dialog_bom.cpp.

Referenced by BOM_CFG_PARSER(), and parsePlugin().


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