trick/trick_source/sim_services/MemoryManager/include/ADefParseContext.hh
Alex Lin 14a75508a3 Cleaning up once include variables and copyright cleanup.
Changed all header file once include variables to follow the same naming
convention and not start with any underscores.  Also deleted old
incorrect copyright notices.  Also removed $Id: tags from all files.

Fixes #14.  Fixes #22.
2015-03-23 16:03:14 -05:00

48 lines
1.6 KiB
C++

#ifndef ADEFPARSECONTEXT_HH
#define ADEFPARSECONTEXT_HH
#include <iostream>
#include <unistd.h>
#include "sim_services/MemoryManager/include/MemoryManager.hh"
/**
The class represents the context for an allocation-declaration parser.
The context provides stuff that the parser needs to know and provides
a place to save results.
*/
namespace Trick {
class ADefParseContext {
public:
int debug ; /**< -- Debug level */
std::istream *is; /**< ** Input Stream */
void *scanner; /**< ** Flex scanner. */
const char *error_str; /**< ** Error description. */
TRICK_TYPE type; /**< ** TRICK_TYPE */
std::string user_type_name; /**< ** User defined type name. */
int n_stars; /**< ** Number of pointers (asterisks) in the definition. */
std::string var_name; /**< ** Name of the variable being defined. */
int n_cdims; /**< ** Number of constrained dimensions. */
int cdims[TRICK_MAX_INDEX]; /**< ** Extents of each of the dimensions. */
ADefParseContext(std::istream* is = &std::cin );
~ADefParseContext();
protected:
/** Initialize the flex scanner for declaration parser. Implemented in decl_parser.l. */
void init_scanner();
/** Destroy the scanner for declaration parser. Implemented in decl_parser.l. */
void destroy_scanner();
};
}
int ADEF_parse( Trick::ADefParseContext* context);
#endif