GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> RIM / V3-1-2 > lrd_parser / rhel4-32
#include <error_p.h>
#include <state_p.h>
#include <cptDetail_p.h>
#include <files_p.h>
#include <tags_p.h>
#include <string.h>
#include <stdlib.h>
Enumerations | |
enum | { INITIAL_STACK_LIMIT = 8 } |
Functions | |
void | init_regState (RegState *state, int verbose) |
Initialises a RegState object for parsing XML files. | |
void | scpt_regState (RegState *state, const char *name, unsigned regWidth, unsigned multi, unsigned suppress) |
Handle the start of a new component by recording some information on a stack and calling the various scpt_file functions. | |
void | sreg_regState (RegState *state, const char *name, unsigned regId, REG_TYPE type) |
Handle the start of a new register updating some state information and calling the various sreg_file functions. | |
void | sfld_regState (RegState *state, const char *name, unsigned width, unsigned offset) |
Handle the start of a new field by calling the various sfld_file functions. | |
void | ereg_regState (RegState *state) |
Call the ereg_file functions. | |
void | ecpt_regState (RegState *state) |
Round out a component by popping some information off the stack and calling the various ecpt_file functions. | |
void | fini_regState (RegState *state) |
Finish off the parsing by closing all the files and clearing the state information. |
$Id: state.c,v 1.6 2011/03/27 06:15:54 saxton Exp $
void ecpt_regState | ( | RegState * | state | ) |
Round out a component by popping some information off the stack and calling the various ecpt_file functions.
state | Parser state being manipulated |
References GenFiles::addr, CptDetail::children, CptDetail::cptChildren, RegState::cptDetail, deleteCptDetail(), GenFiles::description, CptDetail::dtd, ecpt_cptDetail(), ecpt_fileAddr(), ecpt_fileDescription(), ecpt_fileMapDTD(), ecpt_fileMapTags(), ecpt_fileNumEnum(), ecpt_fileRegEnum(), ecpt_fileXMLDTD(), ecpt_fileXMLTags(), RegState::file, CptDetail::mapdtd, GenFiles::mapdtd, CptDetail::mapTag, GenFiles::mapTags, CptDetail::multi, CptDetail::name, CptDetail::nReg, GenFiles::numEnum, GenFiles::regEnum, CptDetail::regEnums, CptDetail::regs, CptDetail::regWidth, RegState::suppressed, CptDetail::tag, GenFiles::xmldtd, and GenFiles::xmlTags.
Referenced by endComponent().
void ereg_regState | ( | RegState * | state | ) |
Call the ereg_file functions.
state | Parser state being manipulated |
References RegState::cptDetail, GenFiles::description, ereg_cptDetail(), ereg_fileDescription(), ereg_fileFldEnum(), ereg_fileXMLDTD(), ereg_fileXMLTags(), RegState::file, GenFiles::fldEnum, CptDetail::name, RegState::nFld, RegState::regId, RegState::regName, RegState::regType, RegState::suppressed, GenFiles::xmldtd, and GenFiles::xmlTags.
Referenced by endRegister().
void fini_regState | ( | RegState * | state | ) |
Finish off the parsing by closing all the files and clearing the state information.
state | State to end |
References GenFiles::addr, RegState::cptDetail, deleteCptDetail(), GenFiles::description, RegState::file, fini_fileAddr(), fini_fileDescription(), fini_fileFldEnum(), fini_fileMapDTD(), fini_fileMapTags(), fini_fileNumber(), fini_fileNumEnum(), fini_fileRegEnum(), fini_fileRimType(), fini_fileTree_c(), fini_fileTree_h(), fini_fileTypeEnum(), fini_fileXMLDTD(), fini_fileXMLTags(), GenFiles::fldEnum, GenFiles::mapdtd, GenFiles::mapTags, GenFiles::number, GenFiles::numEnum, GenFiles::regEnum, GenFiles::rimType, GenFiles::tree_c, GenFiles::tree_h, GenFiles::typeEnum, GenFiles::xmldtd, and GenFiles::xmlTags.
Referenced by main().
void init_regState | ( | RegState * | state, | |
int | verbose | |||
) |
Initialises a RegState object for parsing XML files.
state | State to initialise | |
verbose | Verbosity level for the parser, zero is quiet, non-zero is not |
References GenFiles::addr, RegState::cptDetail, GenFiles::description, RegState::file, GenFiles::fldEnum, init_fileAddr(), init_fileDescription(), init_fileFldEnum(), init_fileMapDTD(), init_fileMapTags(), init_fileNumber(), init_fileNumEnum(), init_fileRegEnum(), init_fileRimType(), init_fileTree_c(), init_fileTree_h(), init_fileTypeEnum(), init_fileXMLDTD(), init_fileXMLTags(), GenFiles::mapdtd, GenFiles::mapTags, GenFiles::number, GenFiles::numEnum, RegState::pState, GenFiles::regEnum, GenFiles::rimType, GenFiles::tree_c, GenFiles::tree_h, GenFiles::typeEnum, GenFiles::xmldtd, and GenFiles::xmlTags.
Referenced by main().
void scpt_regState | ( | RegState * | state, | |
const char * | name, | |||
unsigned | regWidth, | |||
unsigned | multi, | |||
unsigned | suppress | |||
) |
Handle the start of a new component by recording some information on a stack and calling the various scpt_file functions.
state | Parser state being manipulated | |
name | Name of the component | |
regWidth | Width (in bits) of the registers of this component | |
multi | Multiplicity of this component | |
suppress | 1 indicates that this component is not handled by RIM, so the parser should be suppressed. |
References GenFiles::addr, RegState::cptDetail, GenFiles::description, RegState::file, GenFiles::mapdtd, newCptDetail(), RegState::nReg, GenFiles::number, GenFiles::numEnum, GenFiles::rimType, scpt_cptDetail(), scpt_fileAddr(), scpt_fileDescription(), scpt_fileMapDTD(), scpt_fileNumber(), scpt_fileNumEnum(), scpt_fileRimType(), scpt_fileTree_c(), scpt_fileTree_h(), scpt_fileTypeEnum(), scpt_fileXMLDTD(), RegState::suppressed, GenFiles::tree_c, GenFiles::tree_h, GenFiles::typeEnum, and GenFiles::xmldtd.
Referenced by startComponent().
void sfld_regState | ( | RegState * | state, | |
const char * | name, | |||
unsigned | width, | |||
unsigned | offset | |||
) |
Handle the start of a new field by calling the various sfld_file functions.
state | Parser state being manipulated | |
name | Field name | |
width | Number of bits in the field | |
offset | Start bit of the field |
References RegState::cptDetail, GenFiles::description, RegState::file, GenFiles::fldEnum, CptDetail::name, RegState::nFld, RegState::regName, RegState::regType, sfld_cptDetail(), sfld_fileDescription(), sfld_fileFldEnum(), sfld_fileXMLDTD(), sfld_fileXMLTags(), RegState::suppressed, GenFiles::xmldtd, and GenFiles::xmlTags.
Referenced by startField().
Handle the start of a new register updating some state information and calling the various sreg_file functions.
state | Parser state being manipulated | |
name | Register name | |
regId | Register ID | |
type | Type of register, IGN, LATC or INIT |
References RegState::cptDetail, GenFiles::description, CptDetail::dtd, RegState::file, GenFiles::fldEnum, CptDetail::name, RegState::nFld, RegState::regId, RegState::regName, RegState::regType, CptDetail::regWidth, sreg_cptDetail(), sreg_fileDescription(), sreg_fileFldEnum(), sreg_fileXMLDTD(), sreg_fileXMLTags(), RegState::suppressed, GenFiles::xmldtd, and GenFiles::xmlTags.
Referenced by startRegister().