#include <iostream>
#include <iomanip>
#include "debug.h"
Go to the source code of this file.
Defines | |
#define | DEFAULT_FILE_SUFFIX ".e" |
The default extension of compressed files. | |
#define | FILE_STAMP "EX" |
The stamp stored in compressed files. More... | |
#define | B_BITS 32 |
#define | F_BITS 27 |
#define | FRUGAL_BITS 1 |
#define | SEQUENTIAL_ALGORITHM |
#define | OUTPUT(x) std::cout << x |
Print a string on the standard output. More... | |
#define | OUTPUTNL(x) OUTPUT(x << std::endl) |
Print a string and an end of line on the standard output. More... | |
#define | OUTPUTENDLINE std::cout << std::endl |
Print an end of line on the standard output. More... | |
#define | OUTPUTE(x) std::cerr << x |
Print a string on the standard error output. More... | |
#define | OUTPUTENL(x) OUTPUTE(x << std::endl) |
Print a string and an end of line on the standard error output. More... | |
#define | OUTPUTEENDLINE std::cerr << std::endl |
Print and end of line on the standard error output. More... | |
#define | WRN(x) std::cerr << "[WARNING] " << x << std::endl |
Report a warning message. More... | |
#define | ERR(x) std::cerr << "[ERROR] " << x << std::endl |
Report an error message. More... | |
#define | FATAL(x) |
Report a fatal error message. More... | |
#define | PARSERERR(x) std::cerr << std::endl << "[PARSE ERROR] " << x << std::endl |
Report a parser error. More... | |
#define | AMP_REPLACEMENT 6 |
Replacement symbol for ampersands. | |
Enumerations | |
enum | UserAction { Compress, Decompress, WellFormed } |
An anum of user-selectable actions. More... |
This file contains definitions of macros and types used throughout the whole system.
Definition in file defs.h.
|
Default code bits. Definition at line 70 of file defs.h. Referenced by ArithCodec::arithmeticEncode, XmlCodec::decode, XmlCodec::encode, and XmlCodec::initializePushCoder. |
|
Report an error message.
Displays an error message on the standard error output.
Definition at line 224 of file defs.h. Referenced by XmlCodec::decode, TextCodec::getMIB, Context::installSymbol, main, and TextCodec::output. |
|
Default freq bits. Definition at line 77 of file defs.h. Referenced by ArithCodec::arithmeticEncode, XmlCodec::decode, XmlCodec::encode, XmlCodec::initializePushCoder, Context::purgeContext, and Context::setType. |
|
Value: { \ PRINT_SOURCE_POSITION; \ std::cerr << "[FATAL ERROR] " << x << std::endl \ << "Aborting." << std::endl; \ throw ExaltFatalErrorException(); \ }
Displays a fatal error message on the standard error output, and throws the ExaltFatalErrorException exception.
Definition at line 235 of file defs.h. Referenced by KYGrammar::appendToRootRule, ArithCodec::arithmeticEncode, XmlCodec::decode, ExaltCodec::decode, KYGrammar::eatData, Context::encode, Context::initialize, XmlSimpleModel::manageEvent, XmlAdaptiveModel::manageEvent, XmlParser::parse, Context::purgeContext, XmlAdaptiveModel::receiveData, KYGrammar::reductionRule1, OutputSAXReceptor::reportError, KYGrammar::ruleMatchesInput, and Context::setType. |
|
The stamp stored in compressed files.
Exalt uses this stamp to recognize its native file format. Definition at line 55 of file defs.h. Referenced by XmlCodec::decode, XmlCodec::encode, and XmlCodec::initializePushCoder. |
|
This option removes redundant bits from the start and end of coding. The standard implementation is wasteful of bits, outputting 1 at the front, and about B (eg: 32) at the tail of the coding sequence which it doesn't need to. This option saves those bits, but runs slightly slower. Instead of just keeping the difference value, V - L (code value - low value) in the decoder, frugal bits keeps track of the low value and code value separately, so that only the necessary (1 to 3) disambiguating bits need coding/decoding at the end of coding. Although when the decoder discovers this, B_BITS past valid coding output will have been read (possibly past end of file). These bits can be recovered by calling ArithCodec::retrieveExcessInputBits() (for example, if another coding stream was about to start). This saves B - 3 to B - 1 bits (eg: With \aB = 32, saving between 29 and 31 bits). Decoding time is slightly slower, as bitstream window is maintained. Another 1 bit is saved by observing that with the initial range of [0, 0.5) which is used, the first bit of each coding sequence is zero. This bit need not be transmitted. This can be implemented efficiently in the decoder, but slows the encoder which checks each time a bit is output whether it is the first bit of a coding sequence. The encoder would not need to be slowed by this if coding always began at the start of a byte, but we are allowing for consecutive coding sequences (ArithCodec::startEncode(); ... ArithCodec::finishEncode(); pairs) in the same bitstream. The status of this option is not stored in the compressed data. Thus it is up to the user to ensure that the FRUGAL_BITS option is the same when decompressing as when compressing.
|
|
Print a string on the standard output.
Outputs a string on the standard output.
Definition at line 149 of file defs.h. Referenced by XmlParser::characterData, XmlParser::comment, XmlParser::defaultHandler, XmlParser::endCDATASection, XmlParser::endElement, XmlParser::entityDecl, XmlParser::notationDecl, XmlParser::processingInstruction, KYGrammar::reconstructRule, XmlParser::startCDATASection, XmlParser::startDoctypeDecl, XmlParser::startElement, XmlParser::unknownEncoding, and XmlParser::xmlDecl. |
|
Print a string on the standard error output.
Outputs a string on the standard error output.
Definition at line 180 of file defs.h. Referenced by KYGrammar::print, KYGrammar::printDigrams, ElementModeler::printNode, and KYGrammar::~KYGrammar. |
|
Print and end of line on the standard error output.
Outputs an end of line on the standard output.
Definition at line 202 of file defs.h. Referenced by main, KYGrammar::print, ElementModeler::print, KYGrammar::printDigrams, ElementModeler::printNode, KYGrammar::~KYGrammar, XmlAdaptiveModel::~XmlAdaptiveModel, and XmlSimpleModel::~XmlSimpleModel. |
|
Print an end of line on the standard output.
Outputs an end of line on the standard output. |
|
Print a string and an end of line on the standard error output.
Outputs a string and an end of line on the standard error output.
Definition at line 191 of file defs.h. Referenced by main, KYGrammar::print, ElementModeler::print, KYGrammar::printDigrams, KYGrammar::~KYGrammar, XmlAdaptiveModel::~XmlAdaptiveModel, XmlParser::~XmlParser, and XmlSimpleModel::~XmlSimpleModel. |
|
Print a string and an end of line on the standard output.
Outputs a string and an end of line on the standard output.
Definition at line 160 of file defs.h. Referenced by XmlParser::endDoctypeDecl, main, and usage. |
|
Report a parser error.
Displays a parser error message on the standard error output.
Definition at line 252 of file defs.h. Referenced by XmlParser::reportError. |
|
Use sequential algorithm for encoding grammars. (There is no other algorithm implemented yet.) |
|
Report a warning message.
Displays a warning message on the standard error output.
Definition at line 213 of file defs.h. Referenced by KYGrammar::createRootRule, XmlParser::exposeEvent, XmlSimpleModel::manageEvent, and XmlAdaptiveModel::manageEvent. |
|
An anum of user-selectable actions.
Values of this enum are used in the main program to indicate what the user wishes to do.
Definition at line 112 of file defs.h. Referenced by main. |