"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/common.h" between
ragel-7.0.0.11.tar.gz and ragel-7.0.0.12.tar.gz

About: Ragel compiles executable finite state machines from regular languages (C, C++, Obj-C, C#, D, Java, Go and Ruby). Development version.

common.h  (ragel-7.0.0.11):common.h  (ragel-7.0.0.12)
skipping to change at line 26 skipping to change at line 26
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#ifndef _COMMON_H #ifndef _COMMON_H
#define _COMMON_H #define _COMMON_H
#include <iostream>
#include <fstream> #include <fstream>
#include <climits> #include <climits>
#include "dlist.h" #include "dlist.h"
struct colm_location; struct colm_location;
struct InputData; struct InputData;
struct CodeGenData; struct CodeGenData;
struct HostLang; struct HostLang;
struct CodeGenArgs; struct CodeGenArgs;
enum RagelBackend enum RagelBackend
{ {
Direct, Direct,
Translated Translated
}; };
enum BackendFeature enum BackendFeature
{ {
GotoFeature, GotoFeature,
BreakFeature,
VarFeature VarFeature
}; };
#define S8BIT_MIN -128 #define S8BIT_MIN -128
#define S8BIT_MAX 127 #define S8BIT_MAX 127
#define U8BIT_MIN 0 #define U8BIT_MIN 0
#define U8BIT_MAX 255 #define U8BIT_MAX 255
#define S16BIT_MIN -32768 #define S16BIT_MIN -32768
skipping to change at line 219 skipping to change at line 221
bool isSigned; bool isSigned;
bool isOrd; bool isOrd;
bool isChar; bool isChar;
long long sMinVal; long long sMinVal;
long long sMaxVal; long long sMaxVal;
unsigned long long uMinVal; unsigned long long uMinVal;
unsigned long long uMaxVal; unsigned long long uMaxVal;
unsigned int size; unsigned int size;
}; };
typedef void (*GenLineDirectiveT)( std::ostream &out, bool nld, int line, const
char *file );
typedef const char *(*DefaultOutFnT)( const char *inputFileName );
typedef CodeGenData *(*MakeCodeGenT)( const HostLang *hostLang, const CodeGenArg
s &args );
struct HostLang struct HostLang
{ {
/* Target language. */
enum Lang
{
C,
};
const char *name;
const char *arg;
Lang _lang;
HostType *hostTypes; HostType *hostTypes;
int numHostTypes; int numHostTypes;
HostType *defaultAlphType; int defaultAlphType;
bool explicitUnsigned; bool explicitUnsigned;
bool rlhcRequired; bool loopLabels;
const char *rlhcArg;
const char *(*defaultOutFn)( const char *inputFileName );
CodeGenData *(*makeCodeGen)( const HostLang *hostLang, const CodeGenArgs
&args );
RagelBackend backend; RagelBackend backend;
BackendFeature feature; BackendFeature feature;
MakeCodeGenT makeCodeGen;
DefaultOutFnT defaultOutFn;
GenLineDirectiveT genLineDirective;
}; };
void genLineDirectiveC( std::ostream &out, bool nld, int line, const char *file
);
void genLineDirectiveAsm( std::ostream &out, bool nld, int line, const char *fil
e );
void genLineDirectiveTrans( std::ostream &out, bool nld, int line, const char *f
ile );
extern const HostLang hostLangC; extern const HostLang hostLangC;
extern const HostLang hostLangAsm; extern const HostLang hostLangAsm;
extern const HostLang *hostLangs[];
extern const int numHostLangs;
HostType *findAlphType( const HostLang *hostLang, const char *s1 ); HostType *findAlphType( const HostLang *hostLang, const char *s1 );
HostType *findAlphType( const HostLang *hostLang, const char *s1, const char *s2 ); HostType *findAlphType( const HostLang *hostLang, const char *s1, const char *s2 );
HostType *findAlphTypeInternal( const HostLang *hostLang, const char *s1 ); HostType *findAlphTypeInternal( const HostLang *hostLang, const char *s1 );
const char *c_defaultOutFn( const char *inputFileName ); const char *defaultOutFnC( const char *inputFileName );
extern HostType hostTypesC[]; extern HostType hostTypesC[];
/* An abstraction of the key operators that manages key operations such as /* An abstraction of the key operators that manages key operations such as
* comparison and increment according the signedness of the key. */ * comparison and increment according the signedness of the key. */
struct KeyOps struct KeyOps
{ {
/* Default to signed alphabet. */ /* Defaults to C "char" type: Signed 8 bit. */
KeyOps() KeyOps()
: :
isSigned(true) isSigned(true),
explicitUnsigned(true),
minKey(CHAR_MIN),
maxKey(CHAR_MAX)
{} {}
bool isSigned; bool isSigned;
bool explicitUnsigned; bool explicitUnsigned;
Key minKey, maxKey; Key minKey, maxKey;
void setAlphType( const HostLang *hostLang, const HostType *alphType ) void setAlphType( const HostLang *hostLang, const HostType *alphType )
{ {
isSigned = alphType->isSigned; isSigned = alphType->isSigned;
explicitUnsigned = hostLang->explicitUnsigned; explicitUnsigned = hostLang->explicitUnsigned;
skipping to change at line 400 skipping to change at line 403
class output_filter class output_filter
: :
public std::filebuf public std::filebuf
{ {
public: public:
output_filter( const char *fileName ) output_filter( const char *fileName )
: :
fileName(fileName), fileName(fileName),
line(1), line(1),
level(0), level(0),
indent(false) indent(false),
singleIndent(false)
{} {}
virtual int sync(); virtual int sync();
virtual std::streamsize xsputn( const char* s, std::streamsize n ); virtual std::streamsize xsputn( const char* s, std::streamsize n );
std::streamsize countAndWrite( const char* s, std::streamsize n ); std::streamsize countAndWrite( const char* s, std::streamsize n );
const char *fileName; const char *fileName;
int line; int line;
int level; int level;
bool indent; bool indent;
bool singleIndent;
}; };
class nullbuf class nullbuf
: :
public std::streambuf public std::streambuf
{ {
public: public:
virtual std::streamsize xsputn( const char * s, std::streamsize n ) virtual std::streamsize xsputn( const char * s, std::streamsize n )
{ return n; } { return n; }
skipping to change at line 495 skipping to change at line 500
extern exit_object endp; extern exit_object endp;
void operator<<( std::ostream &out, exit_object & ); void operator<<( std::ostream &out, exit_object & );
enum RagelFrontend enum RagelFrontend
{ {
KelbtBased, KelbtBased,
ReduceBased ReduceBased
}; };
CodeGenData *makeCodeGen( const HostLang *hostLang, const CodeGenArgs &args ); CodeGenData *makeCodeGen( const HostLang *hostLang, const CodeGenArgs &args );
CodeGenData *asm_makeCodeGen( const HostLang *hostLang, const CodeGenArgs &args ); CodeGenData *makeCodeGenAsm( const HostLang *hostLang, const CodeGenArgs &args ) ;
#endif #endif
 End of changes. 15 change blocks. 
23 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)