GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LATC / dev > reg_parser / rhel4-32
#include <XLX/XLX.h>
#include <files_p.h>
#include <cptDetail_p.h>
#include <stdio.h>
Classes | |
struct | GenFiles |
Collects together all the file structures used by the parser. More... | |
struct | RegState |
State of a lrd parser. More... | |
Enumerations | |
enum | { REG_NAME_LEN = 40 } |
enum | REG_TYPE { REG_TYPE_IGN = 0, REG_TYPE_LATC = 1, REG_TYPE_INIT = 2 } |
Classification of a register. | |
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) |
Finishes off the parsing by closing all the files and clearing the state information. |
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_fileFldEnum(), ecpt_filelatcType(), ecpt_fileLEM(), ecpt_fileMapDTD(), ecpt_fileMapTags(), ecpt_fileNumber(), ecpt_fileRegEnum(), ecpt_fileTree_c(), ecpt_fileTree_h(), ecpt_fileTypeEnum(), ecpt_fileXMLDTD(), ecpt_fileXMLTags(), RegState::file, GenFiles::fldEnum, GenFiles::latcType, GenFiles::lem, CptDetail::mapdtd, GenFiles::mapdtd, CptDetail::mapTag, GenFiles::mapTags, CptDetail::multi, CptDetail::name, CptDetail::nReg, GenFiles::number, GenFiles::regEnum, CptDetail::regEnums, CptDetail::regs, CptDetail::regWidth, RegState::suppressed, CptDetail::tag, GenFiles::tree_c, GenFiles::tree_h, GenFiles::typeEnum, GenFiles::xmldtd, and GenFiles::xmlTags.
Referenced by endComponent().
void ereg_regState | ( | RegState * | state | ) |
Call the ereg_file functions.
state | Parser state being manipulated |
References GenFiles::addr, RegState::cptDetail, GenFiles::description, ereg_cptDetail(), ereg_fileAddr(), ereg_fileDescription(), ereg_fileFldEnum(), ereg_filelatcType(), ereg_fileLEM(), ereg_fileMapDTD(), ereg_fileMapTags(), ereg_fileNumber(), ereg_fileRegEnum(), ereg_fileTree_c(), ereg_fileTree_h(), ereg_fileTypeEnum(), ereg_fileXMLDTD(), ereg_fileXMLTags(), RegState::file, GenFiles::fldEnum, GenFiles::latcType, GenFiles::lem, GenFiles::mapdtd, GenFiles::mapTags, CptDetail::name, RegState::nFld, GenFiles::number, GenFiles::regEnum, RegState::regId, RegState::regName, RegState::regType, RegState::suppressed, GenFiles::tree_c, GenFiles::tree_h, GenFiles::typeEnum, GenFiles::xmldtd, and GenFiles::xmlTags.
Referenced by endRegister().
void fini_regState | ( | RegState * | state | ) |
Finishes 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_filelatcType(), fini_fileLEM(), fini_fileMapDTD(), fini_fileMapTags(), fini_fileNumber(), fini_fileRegEnum(), fini_fileTree_c(), fini_fileTree_h(), fini_fileTypeEnum(), fini_fileXMLDTD(), fini_fileXMLTags(), GenFiles::fldEnum, GenFiles::latcType, GenFiles::lem, GenFiles::mapdtd, GenFiles::mapTags, GenFiles::number, GenFiles::regEnum, 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_filelatcType(), init_fileLEM(), init_fileMapDTD(), init_fileMapTags(), init_fileNumber(), init_fileRegEnum(), init_fileTree_c(), init_fileTree_h(), init_fileTypeEnum(), init_fileXMLDTD(), init_fileXMLTags(), GenFiles::latcType, GenFiles::lem, lrd, GenFiles::mapdtd, GenFiles::mapTags, GenFiles::number, RegState::pState, GenFiles::regEnum, 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 LATC, so the parser should be suppressed. |
References GenFiles::addr, RegState::cptDetail, GenFiles::description, RegState::file, GenFiles::fldEnum, GenFiles::latcType, GenFiles::lem, GenFiles::mapdtd, GenFiles::mapTags, newCptDetail(), RegState::nReg, GenFiles::number, GenFiles::regEnum, scpt_cptDetail(), scpt_fileAddr(), scpt_fileDescription(), scpt_fileFldEnum(), scpt_filelatcType(), scpt_fileLEM(), scpt_fileMapDTD(), scpt_fileMapTags(), scpt_fileNumber(), scpt_fileRegEnum(), scpt_fileTree_c(), scpt_fileTree_h(), scpt_fileTypeEnum(), scpt_fileXMLDTD(), scpt_fileXMLTags(), RegState::suppressed, GenFiles::tree_c, GenFiles::tree_h, GenFiles::typeEnum, GenFiles::xmldtd, and GenFiles::xmlTags.
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 GenFiles::addr, RegState::cptDetail, GenFiles::description, RegState::file, GenFiles::fldEnum, GenFiles::latcType, GenFiles::lem, GenFiles::mapdtd, GenFiles::mapTags, CptDetail::name, RegState::nFld, GenFiles::number, GenFiles::regEnum, RegState::regName, RegState::regType, sfld_cptDetail(), sfld_fileAddr(), sfld_fileDescription(), sfld_fileFldEnum(), sfld_filelatcType(), sfld_fileLEM(), sfld_fileMapDTD(), sfld_fileMapTags(), sfld_fileNumber(), sfld_fileRegEnum(), sfld_fileTree_c(), sfld_fileTree_h(), sfld_fileTypeEnum(), sfld_fileXMLDTD(), sfld_fileXMLTags(), RegState::suppressed, GenFiles::tree_c, GenFiles::tree_h, GenFiles::typeEnum, 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 GenFiles::addr, RegState::cptDetail, GenFiles::description, CptDetail::dtd, RegState::file, GenFiles::fldEnum, GenFiles::latcType, GenFiles::lem, GenFiles::mapdtd, GenFiles::mapTags, CptDetail::name, RegState::nFld, GenFiles::number, GenFiles::regEnum, RegState::regId, RegState::regName, RegState::regType, CptDetail::regWidth, sreg_cptDetail(), sreg_fileAddr(), sreg_fileDescription(), sreg_fileFldEnum(), sreg_filelatcType(), sreg_fileLEM(), sreg_fileMapDTD(), sreg_fileMapTags(), sreg_fileNumber(), sreg_fileRegEnum(), sreg_fileTree_c(), sreg_fileTree_h(), sreg_fileTypeEnum(), sreg_fileXMLDTD(), sreg_fileXMLTags(), RegState::suppressed, GenFiles::tree_c, GenFiles::tree_h, GenFiles::typeEnum, GenFiles::xmldtd, and GenFiles::xmlTags.
Referenced by startRegister().