"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/common.cc" between
ragel-7.0.0.9.tar.gz and ragel-7.0.0.10.tar.gz

About:

common.cc  (ragel-7.0.0.9):common.cc  (ragel-7.0.0.10)
/* /*
* Copyright 2006-2007 Adrian Thurston <thurston@complang.org> * Copyright 2006-2007 Adrian Thurston <thurston@colm.net>
*/
/* This file is part of Ragel.
* *
* Ragel is free software; you can redistribute it and/or modify * Permission is hereby granted, free of charge, to any person obtaining a copy
* it under the terms of the GNU General Public License as published by * of this software and associated documentation files (the "Software"), to
* the Free Software Foundation; either version 2 of the License, or * deal in the Software without restriction, including without limitation the
* (at your option) any later version. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* *
* Ragel is distributed in the hope that it will be useful, * The above copyright notice and this permission notice shall be included in al
* but WITHOUT ANY WARRANTY; without even the implied warranty of l
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * copies or substantial portions of the Software.
* GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* along with Ragel; if not, write to the Free Software * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* 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
* SOFTWARE.
*/ */
#include "pcheck.h" #include "pcheck.h"
#include "common.h" #include "common.h"
#include "stdlib.h" #include "stdlib.h"
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include "ragel.h" #include "ragel.h"
HostType hostTypesC[] = HostType hostTypesC[] =
skipping to change at line 41 skipping to change at line 42
{ "char", 0, "char", true, true, false, CHAR_MIN, CHAR_ MAX, 0, 0, sizeof(char) }, { "char", 0, "char", true, true, false, CHAR_MIN, CHAR_ MAX, 0, 0, sizeof(char) },
{ "unsigned", "char", "uchar", false, true, false, 0, 0, 0, UCHAR_MAX, sizeof(unsigned char) }, { "unsigned", "char", "uchar", false, true, false, 0, 0, 0, UCHAR_MAX, sizeof(unsigned char) },
{ "short", 0, "short", true, true, false, SHRT_MIN, SHRT_ MAX, 0, 0, sizeof(short) }, { "short", 0, "short", true, true, false, SHRT_MIN, SHRT_ MAX, 0, 0, sizeof(short) },
{ "unsigned", "short", "ushort", false, true, false, 0, 0, 0, USHRT_MAX, sizeof(unsigned short) }, { "unsigned", "short", "ushort", false, true, false, 0, 0, 0, USHRT_MAX, sizeof(unsigned short) },
{ "int", 0, "int", true, true, false, INT_MIN, INT_M AX, 0, 0, sizeof(int) }, { "int", 0, "int", true, true, false, INT_MIN, INT_M AX, 0, 0, sizeof(int) },
{ "unsigned", "int", "uint", false, true, false, 0, 0, 0, UINT_MAX, sizeof(unsigned int) }, { "unsigned", "int", "uint", false, true, false, 0, 0, 0, UINT_MAX, sizeof(unsigned int) },
{ "long", 0, "long", true, true, false, LONG_MIN, LONG_ MAX, 0, 0, sizeof(long) }, { "long", 0, "long", true, true, false, LONG_MIN, LONG_ MAX, 0, 0, sizeof(long) },
{ "unsigned", "long", "ulong", false, true, false, 0, 0, 0, ULONG_MAX, sizeof(unsigned long) }, { "unsigned", "long", "ulong", false, true, false, 0, 0, 0, ULONG_MAX, sizeof(unsigned long) },
}; };
HostType hostTypesD[] =
{
{ "byte", 0, "byte", true, true, false, CHAR_MIN, CHAR_MAX,
0, 0, 1 },
{ "ubyte", 0, "ubyte", false, true, false, 0, 0,
0, UCHAR_MAX, 1 },
{ "char", 0, "char", false, true, false, 0, 0,
0, UCHAR_MAX, 1 },
{ "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX,
0, 0, 2 },
{ "ushort", 0, "ushort", false, true, false, 0, 0,
0, USHRT_MAX, 2 },
{ "wchar", 0, "wchar", false, true, false, 0, 0,
0, USHRT_MAX, 2 },
{ "int", 0, "int", true, true, false, INT_MIN, INT_MAX,
0, 0, 4 },
{ "uint", 0, "uint", false, true, false, 0, 0,
0, UINT_MAX, 4 },
{ "dchar", 0, "dchar", false, true, false, 0, 0,
0, UINT_MAX, 4 },
};
HostType hostTypesGo[] =
{
{ "byte", 0, "uint8", false, true, false, 0, 0,
U8BIT_MIN, U8BIT_MAX, 1 },
{ "int8", 0, "int8", true, true, false, S8BIT_MIN, S8BIT_MAX,
0, 0, 1 },
{ "uint8", 0, "uint8", false, true, false, 0, 0,
U8BIT_MIN, U8BIT_MAX, 1 },
{ "int16", 0, "int16", true, true, false, S16BIT_MIN, S16BIT_MAX
, 0, 0, 2 },
{ "uint16", 0, "uint16", false, true, false, 0, 0,
U16BIT_MIN, U16BIT_MAX, 2 },
{ "int32", 0, "int32", true, true, false, S32BIT_MIN, S32BIT_MAX
, 0, 0, 4 },
{ "uint32", 0, "uint32", false, true, false, 0, 0,
U32BIT_MIN, U32BIT_MAX, 4 },
{ "int64", 0, "int64", true, true, false, S64BIT_MIN, S64BIT_MAX
, 0, 0, 8 },
{ "uint64", 0, "uint64", false, true, false, 0, 0,
U64BIT_MIN, U64BIT_MAX, 8 },
{ "rune", 0, "int32", true, true, true, S32BIT_MIN, S32BIT_MAX
, 0, 0, 4 },
};
HostType hostTypesJava[] =
{
{ "byte", 0, "byte", true, true, false, CHAR_MIN, CHAR_MAX,
0, 0, 1 },
{ "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX,
0, 0, 2 },
{ "char", 0, "char", false, true, false, 0, 0,
0, USHRT_MAX, 2 },
{ "int", 0, "int", true, true, false, INT_MIN, INT_MAX,
0, 0, 4 },
};
/* What are the appropriate types for ruby? */
HostType hostTypesRuby[] =
{
{ "char", 0, "char", true, true, false, CHAR_MIN, CHAR_MAX,
0, 0, 1 },
{ "int", 0, "int", true, true, false, INT_MIN, INT_MAX,
0, 0, 4 },
};
HostType hostTypesCSharp[] =
{
{ "sbyte", 0, "sbyte", true, true, false, CHAR_MIN, CHAR_MAX,
0, 0, 1 },
{ "byte", 0, "byte", false, true, false, 0, 0,
0, UCHAR_MAX, 1 },
{ "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX,
0, 0, 2 },
{ "ushort", 0, "ushort", false, true, false, 0, 0,
0, USHRT_MAX, 2 },
{ "char", 0, "char", false, true, true, 0, 0,
0, USHRT_MAX, 2 },
{ "int", 0, "int", true, true, false, INT_MIN, INT_MAX,
0, 0, 4 },
{ "uint", 0, "uint", false, true, false, 0, 0,
0, UINT_MAX, 4 },
{ "long", 0, "long", true, true, false, LONG_MIN, LONG_MAX,
0, 0, 8 },
{ "ulong", 0, "ulong", false, true, false, 0, 0,
0, ULONG_MAX, 8 },
};
HostType hostTypesOCaml[] =
{
{ "int", 0, "int", true, true, false, S31BIT_MIN, S31BIT_MAX
, 0, 0, 4 },
};
HostType hostTypesCrack[] =
{
{ "byte", 0, "byte", false, true, true, 0, 0,
0, UCHAR_MAX, 1 },
{ "int32", 0, "int32", true, true, false, S32BIT_MIN, S32BIT_M
AX, 0, 0, 4 },
{ "uint32", 0, "uint32", false, true, false, 0, 0,
0, U32BIT_MAX, 4 },
{ "int", 0, "int", true, true, false, INT_MIN, INT_MAX,
0, 0, sizeof(int) },
{ "uint", 0, "uint", false, true, false, 0, 0,
0, UINT_MAX, sizeof(int) },
};
HostType hostTypesRust[] =
{
{ "u8", 0, "byte", true, true, false, 0, UCHAR_MAX, 0, 0, 4
},
};
HostType hostTypesJulia[] =
{
{ "u8", 0, "byte", true, true, false, 0, UCHAR_MAX, 0, 0, 4
},
};
HostType hostTypesJS[] =
{
{ "s8", 0, "int8", true, true, false, CHAR_MIN, CHAR_MAX, 0
, 0, 1 },
{ "u8", 0, "uint8", false, true, false, 0, 0, 0
, UCHAR_MAX, 1 },
{ "s16", 0, "int16", true, true, false, SHRT_MIN, SHRT_MAX, 0
, 0, 2 },
{ "u16", 0, "uint16", false, true, false, 0, 0, 0
, USHRT_MAX, 2 },
{ "i32", 0, "int32", true, true, false, INT_MIN, INT_MAX, 0
, 0, 4 },
{ "u32", 0, "uint32", false, true, false, 0, 0, 0
, UINT_MAX, 4 },
{ "number", 0, "number", true, true, false, LONG_MIN, LONG_MAX, 0
, 0, 8 },
};
const HostLang hostLangC = { const HostLang hostLangC = {
"C", "C",
"-C", "-C",
HostLang::C, HostLang::C,
hostTypesC, 8, hostTypesC, 8,
hostTypesC+0, hostTypesC+0,
true, true,
false, false,
"c" "c"
}; };
skipping to change at line 153 skipping to change at line 64
"ASM", "ASM",
"--asm", "--asm",
HostLang::Asm, HostLang::Asm,
hostTypesC, 8, hostTypesC, 8,
hostTypesC+0, hostTypesC+0,
true, true,
false, false,
"no-lang" "no-lang"
}; };
const HostLang hostLangD = {
"D",
"-D",
HostLang::D,
hostTypesD, 9,
hostTypesD+2,
true,
true,
"d"
};
const HostLang hostLangGo = {
"Go",
"-Z",
HostLang::Go,
hostTypesGo, 10,
hostTypesGo+0,
false,
true,
"go"
};
const HostLang hostLangJava = {
"Java",
"-J",
HostLang::Java,
hostTypesJava, 4,
hostTypesJava+2,
false,
true,
"java"
};
const HostLang hostLangRuby = {
"Ruby",
"-R",
HostLang::Ruby,
hostTypesRuby, 2,
hostTypesRuby+0,
false,
true,
"ruby"
};
const HostLang hostLangCSharp = {
"C#",
"-A",
HostLang::CSharp,
hostTypesCSharp, 9,
hostTypesCSharp+4,
true,
true,
"csharp"
};
const HostLang hostLangOCaml = {
"OCaml",
"-O",
HostLang::OCaml,
hostTypesOCaml, 1,
hostTypesOCaml+0,
false,
true,
"ocaml"
};
const HostLang hostLangCrack = {
"Crack",
"-K",
HostLang::Crack,
hostTypesCrack, 5,
hostTypesCrack+0,
true,
true,
"crack"
};
const HostLang hostLangRust = {
"Rust",
"-U",
HostLang::Rust,
hostTypesRust, 1,
hostTypesRust+0,
false,
true,
"rust"
};
const HostLang hostLangJulia = {
"Julia",
"-Y",
HostLang::Julia,
hostTypesJulia, 1,
hostTypesJulia+0,
false,
true,
"julia"
};
const HostLang hostLangJS = {
"JavaScript",
"-P",
HostLang::JS,
hostTypesJS, 7,
hostTypesJS+1,
false,
true,
"js"
};
const HostLang *hostLangs[] = { const HostLang *hostLangs[] = {
&hostLangC, &hostLangC,
&hostLangAsm, &hostLangAsm,
&hostLangD,
&hostLangGo,
&hostLangJava,
&hostLangRuby,
&hostLangCSharp,
&hostLangOCaml,
&hostLangRust,
&hostLangCrack,
&hostLangJulia,
&hostLangJS,
}; };
const int numHostLangs = sizeof(hostLangs)/sizeof(hostLangs[0]); const int numHostLangs = sizeof(hostLangs)/sizeof(hostLangs[0]);
HostType *findAlphType( const HostLang *hostLang, const char *s1 ) HostType *findAlphType( const HostLang *hostLang, const char *s1 )
{ {
for ( int i = 0; i < hostLang->numHostTypes; i++ ) { for ( int i = 0; i < hostLang->numHostTypes; i++ ) {
if ( strcmp( s1, hostLang->hostTypes[i].data1 ) == 0 && if ( strcmp( s1, hostLang->hostTypes[i].data1 ) == 0 &&
hostLang->hostTypes[i].data2 == 0 ) hostLang->hostTypes[i].data2 == 0 )
{ {
 End of changes. 7 change blocks. 
274 lines changed or deleted 17 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS