GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > RIM / V2-2-0

Constituent: lrd_parser     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

files.c File Reference

Structures and functions associated with the files produced by the LRD parser. More...

#include "error_p.h"
#include "files_p.h"
#include "fileUtils_p.h"
#include "lString_p.h"
#include "PBS/MBA.h"
#include <string.h>
#include <stdlib.h>

Include dependency graph for files.c:


Enumerations

enum  {
  IS_IMPL = 0,
  IS_HEADER = 1
}
enum  { INITIAL_STACK_LIMIT = 8 }

Functions

void init_fileRimType (FileRimType *file)
 Initialise the file structure by opening the file and writing some initial statements to it.
void scpt_fileRimType (FileRimType *file, const char *name)
 Write out the component name.
void fini_fileRimType (FileRimType *file)
 Write out the last line and close the file.
void init_fileTypeEnum (FileTypeEnum *file)
 Initialise the file structure by opening the file and writing some initial statements to it.
void scpt_fileTypeEnum (FileTypeEnum *file, const char *name)
 Write out a line defining the RIM_xxx symbol for the component.
void fini_fileTypeEnum (FileTypeEnum *file)
 Write out the last line and close the file.
void init_fileRegEnum (FileRegEnum *file)
 Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.
void ecpt_fileRegEnum (FileRegEnum *file, L_head *enums)
 Write out an enumeration of the registers within a component.
void fini_fileRegEnum (FileRegEnum *file)
 Close the file.
void init_fileFldEnum (FileFldEnum *file)
 Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.
void sreg_fileFldEnum (FileFldEnum *file, const char *cptName, const char *regName)
 Start an enumeration of the fields inside this register, begining with a special "register" field that represents the whole register.
void sfld_fileFldEnum (FileFldEnum *file, const char *cptName, const char *regName, const char *fldName, unsigned nFld)
 Write out an enumeration for the field.
void ereg_fileFldEnum (FileFldEnum *file)
 Finish off the enumeration.
void fini_fileFldEnum (FileFldEnum *file)
 Close the file.
void init_fileDescription (FileDescription *file)
 Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.
void scpt_fileDescription (FileDescription *file, const char *name)
 Add the component name to the list held in the file structure.
void sreg_fileDescription (FileDescription *file, const char *cptName, const char *regName, unsigned regWidth)
 Start an array of Field Descriptions for this register, begining with the special "register" field that holds the whole register.
void sfld_fileDescription (FileDescription *file, unsigned width, unsigned offset)
 Add an element to the array of Field Descriptions for this field.
void ereg_fileDescription (FileDescription *file)
 Close out the array of Field Descriptions.
void ecpt_fileDescription (FileDescription *file, L_head *regs, const char *name, unsigned regWidth, unsigned nReg)
 Write out the Register and Component Descriptions.
void fini_fileDescription (FileDescription *file)
 Write out an array of Component Descriptions to complete the LAT description and close the file.
void init_fileXMLTags (FileXMLTags *file)
 Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.
void sreg_fileXMLTags (FileXMLTags *file, const char *cptName, const char *regName)
 Print out the structure defining the XML tag for this register.
void sfld_fileXMLTags (FileXMLTags *file, const char *cptName, const char *regName, const char *fldName)
 Print out the structure defining the XML tag for this field.
void ereg_fileXMLTags (FileXMLTags *file, const char *cptName, const char *regName)
 Print out the array of children for this register and the register tag.
void ecpt_fileXMLTags (FileXMLTags *file, L_head *children, const char *tag, const char *base_name)
 Print out the structures defining the XML tags associated with this component.
void fini_fileXMLTags (FileXMLTags *file)
 Finish off the XML vocabulary for the rim_parser by writing out an array of tags that are children of the document element, the base tags.
void init_fileXMLDTD (FileXMLDTD *file)
 Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.
void scpt_fileXMLDTD (FileXMLDTD *file, const char *base_name)
 If this component has no parent then base_name is not NULL and should be added the list of base tags.
void sreg_fileXMLDTD (FileXMLDTD *file, L_head *cptDtd, const char *regName)
 Add this register to the list of elements contained by the parent component.
void sfld_fileXMLDTD (FileXMLDTD *file, const char *fldName)
 Add the field name to the list of field names held in the file structure and add an XML element declaration to the list of field elements held in this structure.
void ereg_fileXMLDTD (FileXMLDTD *file, const char *regName)
 Add a declaration of the register element to the list of strings making up the DTD.
void ecpt_fileXMLDTD (FileXMLDTD *file, const char *cptName, L_head *dtdCpt, unsigned multi)
 Write out the component portion of the DTD.
void fini_fileXMLDTD (FileXMLDTD *file)
 Write out the complete DTD and close the file.
void init_fileMapTags (FileMapTags *file)
 Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.
void ecpt_fileMapTags (FileMapTags *file, L_head *children, const char *tag, const char *base_name)
 Print out the structures defining the Map tags associated with this component.
void fini_fileMapTags (FileMapTags *file)
 Finish off the Map vocabulary for the rim_parser by writing out an array of tags that are children of the document element, the base tags.
void init_fileMapDTD (FileMapDTD *file)
 Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.
void scpt_fileMapDTD (FileMapDTD *file, const char *base_name)
 If this component has no parent then base_name is not NULL and should be added the list of base tags.
void ecpt_fileMapDTD (FileMapDTD *file, const char *cptName, L_head *dtdCpt)
 Write out the component portion of the DTD.
void fini_fileMapDTD (FileMapDTD *file)
 Write out the complete DTD and close the file.
void init_fileTree_c (FileTree_c *file)
 Initialise the file structure by opening the file and writing some initial statements to it.
void scpt_fileTree_c (FileTree_c *file, const char *name)
 Write out a line initializing a RIM pointer.
void fini_fileTree_c (FileTree_c *file)
 Write out the last line and close the file.
void init_fileTree_h (FileTree_h *file)
 Initialise the file structure by opening the file and writing some initial statements to it.
void scpt_fileTree_h (FileTree_h *file, const char *name)
 Write out a line defining the component pointer array.
void fini_fileTree_h (FileTree_h *file)
 Write out the last lines and close the file.
void init_fileNumEnum (FileNumEnum *file)
 Initialise the file structure by opening the file and writing some initial statements to it.
void scpt_fileNumEnum (FileNumEnum *file, const char *name, unsigned multi)
 Write a line defining the maximum ID for this component.
void ecpt_fileNumEnum (FileNumEnum *file)
 Peel back the hierarchy by decrementing the index and clearing one element of the addrRng array.
void fini_fileNumEnum (FileNumEnum *file)
 Write out the last line and close the file.
void init_fileNumber (FileNumber *file)
 Initialise the file structure by opening the file and writing some initial statements to it.
void scpt_fileNumber (FileNumber *file, const char *name)
 Write the name of the maximum index for this component to the file.
void fini_fileNumber (FileNumber *file)
 Write the last line to the output file and close it.
void init_fileAddr (FileAddr *file)
 Initialise the file structure by opening the file and writing some initial statements to it.
void scpt_fileAddr (FileAddr *file, unsigned multi)
 Write out an array indicating the acceptable ranges of address indices for the LAT component.
void ecpt_fileAddr (FileAddr *file)
 Decrements the index indicating depth in the hierarchy and clears the relevant addr bit.
void fini_fileAddr (FileAddr *file)
 Write the last line and close the file.

Variables

static const char * rfn_hPath = "../RIM"
 Interface path.
static const char * rfn_cPath = "../src"
 Implementation path.
static const char * rfn_type = "RIM_AG_types"
 Type definitions.
static const char * rfn_regE = "RIM_AG_regEnums"
 Register enumerations.
static const char * rfn_fldE = "RIM_AG_fldEnums"
 Field enumerations.
static const char * rfn_desc = "RIM_AG_descriptions"
 Descriptions.
static const char * rfn_tags = "RIM_AG_xml_tags"
 XML tags.
static const char * rfn_mapTags = "RIM_AG_map_tags"
 Mapping XML tags.
static const char * rfn_dtd = "rim"
 DTD.
static const char * rfn_mapdtd = "map"
 Map DTD.
static const char * rfn_tree = "RIM_AG_init"
 Definition of the RIM structure.
static const char * rfn_numb = "RIM_AG_number"
 File creating number array.
static const char * rfn_addr = "RIM_AG_addr"
 Range of acceptable addresses.
static const char * rfn_defs = "RIM_p.h"
 General definitions.
static const char * rfn_prsr = "RIM_ground_p.h"
 Parser/ground definitions.

Detailed Description

Structures and functions associated with the files produced by the LRD parser.

Author:
James Swain & Owen Saxton
Id
files.c,v 1.5 2007/12/14 21:32:18 saxton Exp

Function Documentation

void ecpt_fileAddr FileAddr file  ) 
 

Decrements the index indicating depth in the hierarchy and clears the relevant addr bit.

Parameters:
file Pointer to the addresses file data structure

void ecpt_fileDescription FileDescription file,
L_head *  regs,
const char *  name,
unsigned  regWidth,
unsigned  nReg
 

Write out the Register and Component Descriptions.

Parameters:
file Pointer to the descriptions file data structure
regs List of strings used to construct the Register Description
name Component name
regWidth Number of bits in the registers of this component
nReg Number of registers in this component

void ecpt_fileMapDTD FileMapDTD file,
const char *  cptName,
L_head *  dtdCpt
 

Write out the component portion of the DTD.

Parameters:
file Pointer to the map DTD file data structure
cptName Component name
dtdCpt List of children elements of the component

void ecpt_fileMapTags FileMapTags file,
L_head *  children,
const char *  tag,
const char *  base_name
 

Print out the structures defining the Map tags associated with this component.

Parameters:
file Pointer to the map tags file data structure
children List of strings that form an array of children of this component
tag String defining the Map tag for this component
base_name NULL if this component has a parent, otherwise the name of this component

void ecpt_fileNumEnum FileNumEnum file  ) 
 

Peel back the hierarchy by decrementing the index and clearing one element of the addrRng array.

Parameters:
file Pointer to the numbers file data structure

void ecpt_fileRegEnum FileRegEnum file,
L_head *  enums
 

Write out an enumeration of the registers within a component.

Parameters:
file Pointer to the register enumerations file data structure
enums List of register enumerations

void ecpt_fileXMLDTD FileXMLDTD file,
const char *  cptName,
L_head *  dtdCpt,
unsigned  multi
 

Write out the component portion of the DTD.

Parameters:
file Pointer to the XML DTD file data structure
cptName Component name
dtdCpt List of children elements of the component
multi Multiplicity of this component

void ecpt_fileXMLTags FileXMLTags file,
L_head *  children,
const char *  tag,
const char *  base_name
 

Print out the structures defining the XML tags associated with this component.

Parameters:
file Pointer to the XML tags file data structure
children List of strings that form an array of children of this component
tag String defining the XML tag for this component
base_name NULL if this component has a parent, otherwise the name of this component

void ereg_fileDescription FileDescription file  ) 
 

Close out the array of Field Descriptions.

Parameters:
file Pointer to the descriptions file data structure

void ereg_fileFldEnum FileFldEnum file  ) 
 

Finish off the enumeration.

Parameters:
file Pointer to the field enumerations file data structure

void ereg_fileXMLDTD FileXMLDTD file,
const char *  regName
 

Add a declaration of the register element to the list of strings making up the DTD.

Parameters:
file Pointer to the XML DTD file data structure
regName Register name

void ereg_fileXMLTags FileXMLTags file,
const char *  cptName,
const char *  regName
 

Print out the array of children for this register and the register tag.

Parameters:
file Pointer to the XML tags file data structure
cptName Name of the current component
regName Name of register ending

void fini_fileAddr FileAddr file  ) 
 

Write the last line and close the file.

Parameters:
file Pointer to the addresses file data structure

void fini_fileDescription FileDescription file  ) 
 

Write out an array of Component Descriptions to complete the LAT description and close the file.

Parameters:
file Pointer to the descriptions file data structure

void fini_fileFldEnum FileFldEnum file  ) 
 

Close the file.

Parameters:
file Pointer to the field enumerations file data structure

void fini_fileMapDTD FileMapDTD file  ) 
 

Write out the complete DTD and close the file.

Parameters:
file Pointer to the map DTD file data structure

void fini_fileMapTags FileMapTags file  ) 
 

Finish off the Map vocabulary for the rim_parser by writing out an array of tags that are children of the document element, the base tags.

Parameters:
file Pointer to the map tags file data structure

void fini_fileNumber FileNumber file  ) 
 

Write the last line to the output file and close it.

Parameters:
file Pointer to the numbers file data structure

void fini_fileNumEnum FileNumEnum file  ) 
 

Write out the last line and close the file.

Parameters:
file Pointer to the numbers file data structure

void fini_fileRegEnum FileRegEnum file  ) 
 

Close the file.

Parameters:
file Pointer to the register enumerations file data structure

void fini_fileRimType FileRimType file  ) 
 

Write out the last line and close the file.

Parameters:
file Pointer to the RIM type file data structure

void fini_fileTree_c FileTree_c file  ) 
 

Write out the last line and close the file.

Parameters:
file Pointer to the initialization file data structure

void fini_fileTree_h FileTree_h file  ) 
 

Write out the last lines and close the file.

Parameters:
file Pointer to the parse tree file data structure

void fini_fileTypeEnum FileTypeEnum file  ) 
 

Write out the last line and close the file.

Parameters:
file Pointer to the type enumerations file data structure

void fini_fileXMLDTD FileXMLDTD file  ) 
 

Write out the complete DTD and close the file.

Parameters:
file Pointer to the XML DTD file data structure

void fini_fileXMLTags FileXMLTags file  ) 
 

Finish off the XML vocabulary for the rim_parser by writing out an array of tags that are children of the document element, the base tags.

Parameters:
file Pointer to the XML tags file data structure

void init_fileAddr FileAddr file  ) 
 

Initialise the file structure by opening the file and writing some initial statements to it.

Parameters:
file Pointer to the addresses file data structure

void init_fileDescription FileDescription file  ) 
 

Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.

Parameters:
file Pointer to the descriptions file data structure

void init_fileFldEnum FileFldEnum file  ) 
 

Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.

Parameters:
file Pointer to the field enumerations file data structure

void init_fileMapDTD FileMapDTD file  ) 
 

Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.

Parameters:
file Pointer to the map DTD file data structure

void init_fileMapTags FileMapTags file  ) 
 

Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.

Parameters:
file Pointer to the map tags file data structure

void init_fileNumber FileNumber file  ) 
 

Initialise the file structure by opening the file and writing some initial statements to it.

Parameters:
file Pointer to the numbers file data structure

void init_fileNumEnum FileNumEnum file  ) 
 

Initialise the file structure by opening the file and writing some initial statements to it.

Parameters:
file Pointer to the numbers file data structure

void init_fileRegEnum FileRegEnum file  ) 
 

Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.

Parameters:
file Pointer to the register enumerations file data structure

void init_fileRimType FileRimType file  ) 
 

Initialise the file structure by opening the file and writing some initial statements to it.

Parameters:
file Pointer to the RIM type file data structure

void init_fileTree_c FileTree_c file  ) 
 

Initialise the file structure by opening the file and writing some initial statements to it.

Parameters:
file Pointer to the initialization file data structure

void init_fileTree_h FileTree_h file  ) 
 

Initialise the file structure by opening the file and writing some initial statements to it.

Parameters:
file Pointer to the parse tree file data structure

void init_fileTypeEnum FileTypeEnum file  ) 
 

Initialise the file structure by opening the file and writing some initial statements to it.

Parameters:
file Pointer to the type enumerations file data structure

void init_fileXMLDTD FileXMLDTD file  ) 
 

Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.

Parameters:
file Pointer to the XML DTD file data structure

void init_fileXMLTags FileXMLTags file  ) 
 

Initialise the file structure by opening the file, writing some initial statements to it and initialising any lists.

Parameters:
file Pointer to the XML tags file data structure

void scpt_fileAddr FileAddr file,
unsigned  multi
 

Write out an array indicating the acceptable ranges of address indices for the LAT component.

Parameters:
file Pointer to the addresses file data structure
multi Multiplicity of this component

void scpt_fileDescription FileDescription file,
const char *  name
 

Add the component name to the list held in the file structure.

Parameters:
file Pointer to the descriptions file data structure
name Component name

void scpt_fileMapDTD FileMapDTD file,
const char *  base_name
 

If this component has no parent then base_name is not NULL and should be added the list of base tags.

Parameters:
file Pointer to the map DTD file data structure
base_name NULL if this component is contained by another component, otherwise the component name

void scpt_fileNumber FileNumber file,
const char *  name
 

Write the name of the maximum index for this component to the file.

Parameters:
file Pointer to the numbers file data structure
name Component name

void scpt_fileNumEnum FileNumEnum file,
const char *  name,
unsigned  multi
 

Write a line defining the maximum ID for this component.

Parameters:
file Pointer to the numbers file data structure
name Component name
multi Multiplicity of this component

void scpt_fileRimType FileRimType file,
const char *  name
 

Write out the component name.

Parameters:
file Pointer to the RIM type file data structure
name String giving the component name

void scpt_fileTree_c FileTree_c file,
const char *  name
 

Write out a line initializing a RIM pointer.

Parameters:
file Pointer to the initialization file data structure
name Component name

void scpt_fileTree_h FileTree_h file,
const char *  name
 

Write out a line defining the component pointer array.

Parameters:
file Pointer to the parse tree file data structure
name Component name

void scpt_fileTypeEnum FileTypeEnum file,
const char *  name
 

Write out a line defining the RIM_xxx symbol for the component.

Parameters:
file Pointer to the type enumerations file data structure
name Component name

void scpt_fileXMLDTD FileXMLDTD file,
const char *  base_name
 

If this component has no parent then base_name is not NULL and should be added the list of base tags.

Parameters:
file Pointer to the XML DTD file data structure
base_name NULL if this component is contained by another component, otherwise the component name

void sfld_fileDescription FileDescription file,
unsigned  width,
unsigned  offset
 

Add an element to the array of Field Descriptions for this field.

Parameters:
file Pointer to the descriptions file data structure
width Number of bits in this field
offset Start bit of the field

void sfld_fileFldEnum FileFldEnum file,
const char *  cptName,
const char *  regName,
const char *  fldName,
unsigned  nFld
 

Write out an enumeration for the field.

Parameters:
file Pointer to the field enumerations file data structure
cptName Name of the component containing this field
regName Name of the register holding this field
fldName Name of the field
nFld Number of this field

void sfld_fileXMLDTD FileXMLDTD file,
const char *  fldName
 

Add the field name to the list of field names held in the file structure and add an XML element declaration to the list of field elements held in this structure.

Parameters:
file Pointer to the XML DTD file data structure
fldName Name of the current field

void sfld_fileXMLTags FileXMLTags file,
const char *  cptName,
const char *  regName,
const char *  fldName
 

Print out the structure defining the XML tag for this field.

Parameters:
file Pointer to the XML tags file data structure
cptName Component name
regName Register name
fldName Field name

void sreg_fileDescription FileDescription file,
const char *  cptName,
const char *  regName,
unsigned  regWidth
 

Start an array of Field Descriptions for this register, begining with the special "register" field that holds the whole register.

Parameters:
file Pointer to the descriptions file data structure
cptName Name of the compoment holding this register
regName Name of the register
regWidth Number of bits in the register

void sreg_fileFldEnum FileFldEnum file,
const char *  cptName,
const char *  regName
 

Start an enumeration of the fields inside this register, begining with a special "register" field that represents the whole register.

Parameters:
file Pointer to the field enumerations file data structure
cptName Name of the component containing this register
regName Name of the register

void sreg_fileXMLDTD FileXMLDTD file,
L_head *  cptDtd,
const char *  regName
 

Add this register to the list of elements contained by the parent component.

Parameters:
file Pointer to the XML DTD file data structure
cptDtd List of elements contained by the current component
regName Register name

void sreg_fileXMLTags FileXMLTags file,
const char *  cptName,
const char *  regName
 

Print out the structure defining the XML tag for this register.

Parameters:
file Pointer to the XML tags file data structure
cptName Component name
regName Register name


Generated on Sat Dec 22 02:47:59 2007 by  doxygen 1.4.4