Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3

This commit is contained in:
Vítor Santos Costa 2015-02-10 09:20:12 +00:00
commit 9743c81f05
20 changed files with 6953 additions and 2086 deletions

View File

@ -737,8 +737,10 @@ AdjustScannerStacks(TokEntry **tksp, VarEntry **vep USES_REGS)
break;
case Var_tok:
case String_tok:
if (IsOldTrail(tks->TokInfo))
tks->TokInfo = TrailAdjust(tks->TokInfo);
case WString_tok:
case StringTerm_tok:
if (IsOldTrail(tks->TokInfo))
tks->TokInfo = TrailAdjust(tks->TokInfo);
break;
case Name_tok:
tks->TokInfo = (Term)AtomAdjust((Atom)(tks->TokInfo));

View File

@ -350,19 +350,25 @@ syntax_error (TokEntry * tokptr, IOSTREAM *st, Term *outp)
ts[0] = Yap_MkApplTerm(Yap_MkFunctor(AtomGVar,3),3,t);
}
break;
case String_tok:
{
Term t0 = Yap_CharsToListOfCodes((const char *)info PASS_REGS);
ts[0] = Yap_MkApplTerm(Yap_MkFunctor(AtomString,1),1,&t0);
}
break;
case WString_tok:
{
Term t0 = Yap_WCharsToListOfCodes((const wchar_t *)info PASS_REGS);
ts[0] = Yap_MkApplTerm(Yap_MkFunctor(AtomString,1),1,&t0);
}
break;
case Error_tok:
case String_tok:
{
Term t0 = Yap_CharsToListOfCodes((const char *)info PASS_REGS);
ts[0] = Yap_MkApplTerm(Yap_MkFunctor(AtomString,1),1,&t0);
}
break;
case StringTerm_tok:
{
Term t0 = MkStringTerm((const char *)info);
ts[0] = Yap_MkApplTerm(Yap_MkFunctor(AtomString,1),1,&t0);
}
break;
case WString_tok:
{
Term t0 = Yap_WCharsToListOfCodes((const wchar_t *)info PASS_REGS);
ts[0] = Yap_MkApplTerm(Yap_MkFunctor(AtomString,1),1,&t0);
}
break;
case Error_tok:
case eot_tok:
break;
case Ponctuation_tok:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

795
C/write.c

File diff suppressed because it is too large Load Diff

View File

@ -509,13 +509,18 @@ ADD_SUBDIRECTORY(swi/library)
# ADD_SUBDIRECTORY(os)
# ADD_SUBDIRECTORY(packages)
if (BUILD_JIT)
add_definitions (-DYAP_JIT=1)
INCLUDE_DIRECTORIES(JIT JIT/HPP)
macro_optional_add_subdirectory(JIT ON)
endif()
macro_optional_find_package (LLVM ON)
macro_log_feature (LLVM_FOUND "LLVM JIT generator"
"The LLVM Compiler Infrastructure" "http://www.llvm.org")
if (LLVM_FOUND)
add_definitions (-DYAP_JIT=1)
INCLUDE_DIRECTORIES(JIT JIT/HPP)
macro_optional_add_subdirectory(JIT)
endif()
macro_optional_add_subdirectory(library/mpi)
macro_optional_add_subdirectory(library/lammpi)
macro_optional_add_subdirectory (packages/gecode)

View File

@ -4,6 +4,7 @@ typedef enum TokenKinds {
Var_tok,
String_tok,
WString_tok,
StringTerm_tok,
Ponctuation_tok,
Error_tok,
QuasiQuotes_tok,
@ -29,4 +30,3 @@ typedef struct VARSTRUCT {
struct VARSTRUCT *VarLeft, *VarRight;
char VarRep[1];
} VarEntry;

View File

@ -336,7 +336,7 @@ typedef struct environment {
#if YAP_JIT
/* Enumeration for types of basic blocks -- used on trace construction */
typedef enum {
typedef enum block_try {
NONE, // untyped
SIMPLE_ENTRY, // first basic block of any yaam opcode
SIMPLE, // any other basic block of any yaam opcode

View File

@ -149,36 +149,6 @@ extern YP_FILE yp_iob[YP_MAX_FILES];
typedef YP_FILE *YP_File;
/* ricardo
typedef enum TokenKinds {
Name_tok,
Number_tok,
Var_tok,
String_tok,
WString_tok,
Ponctuation_tok,
Error_tok,
eot_tok
} tkinds;
typedef struct TOKEN {
enum TokenKinds Tok;
Term TokInfo;
int TokPos;
struct TOKEN *TokNext;
} TokEntry;
#define Ord(X) ((enum TokenKinds) (X))
#define NextToken GNextToken( PASS_REGS1 )
typedef struct VARSTRUCT {
Term VarAdr;
CELL hv;
struct VARSTRUCT *VarLeft, *VarRight;
char VarRep[1];
} VarEntry;
*/
#ifndef _PL_WRITE_
@ -351,5 +321,3 @@ WideHashFunction(wchar_t *CHP)
#define QUIET_ON_PARSER_ERROR 1
#define CONTINUE_ON_PARSER_ERROR 2
#define EXCEPTION_ON_PARSER_ERROR 3

View File

@ -16,11 +16,6 @@ set(LIBJIT_SOURCES
JIT_Init.cpp
)
macro_optional_find_package (LLVM ON)
macro_log_feature (LLVM_FOUND "LLVM JIT generator"
"The LLVM Compiler Infrastructure" "http://www.llvm.org")
# The following variables are defined:
# LLVM_FOUND - true if LLVM was found
# LLVM_CXXFLAGS - C++ compiler flags for files that include LLVM headers.

View File

@ -1194,7 +1194,7 @@ initPrologFlags(void)
setPrologFlag("colon_sets_calling_context", FT_BOOL|FF_READONLY, TRUE, 0);
setPrologFlag("character_escapes", FT_BOOL, TRUE, PLFLAG_CHARESCAPE);
setPrologFlag("char_conversion", FT_BOOL, FALSE, PLFLAG_CHARCONVERSION);
setPrologFlag("backquoted_string", FT_BOOL, FALSE, PLFLAG_BACKQUOTED_STRING);
setPrologFlag("backquoted_string", FT_BOOL, TRUE, PLFLAG_BACKQUOTED_STRING);
#ifdef O_QUASIQUOTATIONS
setPrologFlag("quasi_quotations", FT_BOOL, TRUE, PLFLAG_QUASI_QUOTES);
#endif
@ -1329,4 +1329,3 @@ BeginPredDefs(prologflag)
EndPredDefs
//! @}

View File

@ -252,3 +252,21 @@ utf8_strprefix(const char *s1, const char *s2)
return 0;
}
char *
utf8_wcscpy(char *sf, const wchar_t *s0)
{
char *sf0 = sf;
while(1)
{ int chr1;
chr1 = * s0++;
if (chr1 == '\0') {
*sf++ = '\0';
return sf0;
}
sf = utf8_put_char(sf, chr1);
}
return NULL;
}

View File

@ -26,6 +26,8 @@
#ifndef UTF8_H_INCLUDED
#define UTF8_H_INCLUDED
#include <wchar.h>
#define PL_MB_LEN_MAX 16
#define UTF8_MALFORMED_REPLACEMENT 0xfffd
@ -66,6 +68,8 @@ extern size_t utf8_strlen1(const char *s);
extern const char * utf8_skip(const char *s, int n);
extern int utf8_strncmp(const char *s1, const char *s2, size_t n);
extern int utf8_strprefix(const char *s1, const char *s2);
/// copy a wide string to an UTF-8 version.
extern char *utf8_wcscpy(char *sf, const wchar_t *s0);
typedef enum {
S_ASCII,

View File

@ -711,7 +711,7 @@ pl_write_canonical2(term_t stream, term_t term)
rc = ( numberVars(term, &options, 0 PASS_LD) >= 0 &&
do_write2(stream, term,
PL_WRT_QUOTED|PL_WRT_IGNOREOPS|PL_WRT_NUMBERVARS)
PL_WRT_QUOTED|PL_WRT_IGNOREOPS|PL_WRT_NUMBERVARS|PLFLAG_BACKQUOTED_STRING)
);
END_NUMBERVARS(TRUE);
@ -796,5 +796,3 @@ pl_writeln(term_t term)
BeginPredDefs(write)
EndPredDefs

@ -1 +1 @@
Subproject commit 849232fea0f549f6704b16afa1c986e0d50ec177
Subproject commit 8257467ff9a7bb901d1688e6a75ad072e0246aba

File diff suppressed because it is too large Load Diff

@ -1 +1 @@
Subproject commit d0d1ee4d58373cc611676103e0a50a3ae451a023
Subproject commit 9972458293415b2d72276bd67875767bfeed00df

View File

@ -1,4 +1,7 @@
#ifdef _XOPEN_SOURCE
#undef _XOPEN_SOURCE // python does its own thing
#endif
#include <Python.h>
#include <SWI-Stream.h>
#include <SWI-Prolog.h>
@ -1677,4 +1680,3 @@ install_python(void)
PL_register_foreign("python_run_command", 1, python_run_command, 0);
PL_register_foreign("python_main_module", 1, python_main_module, 0);
}

@ -1 +1 @@
Subproject commit 34d9f645721645aac9f4f40c815fe4fe2c6511e6
Subproject commit 36f99e3c3c978fef25f899dc4fab1ffee334d73c

View File

@ -1,5 +1,30 @@
package pt.up.fc.dcc.yap;
/**** using sqlite
For example,the following:
import android.database.sqlite.SQLiteDatabase;
should be replaced with:
import org.sqlite.database.sqlite.SQLiteDatabase;
As well as replacing all uses of the classes in the android.database.sqlite.* namespace, the application must also be sure to use the following two:
org.sqlite.database.SQLException
org.sqlite.database.DatabaseErrorHandler
instead of:
android.database.SQLException
android.database.DatabaseErrorHandler
Aside from namespace changes, there are other differences from the stock Android interface that applications need to be aware of:
The SQLiteStatement.simpleQueryForBlobFileDescriptor() API is not available. The collation sequence "UNICODE" is not available. The collation sequence "LOCALIZED", which normally changes with the system's current locale, is always equivalent to SQLite's built in collation BINARY.
****/
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
@ -18,6 +43,7 @@ import org.sqlite.database.sqlite.SQLiteStatement;
import org.sqlite.database.sqlite.SQLiteDatabaseCorruptException;
import org.sqlite.database.sqlite.SQLiteOpenHelper;
import org.sqlite.database.SQLException;
import org.sqlite.database.DatabaseErrorHandler;
class DoNotDeleteErrorHandler implements DatabaseErrorHandler {
private static final String TAG = "DoNotDeleteErrorHandler";
@ -49,7 +75,7 @@ public class JavaYap extends Activity
// text.setText("");
if (vs0.nil()) {
if (BuildConfig.DEBUG) {
Log.i(TAG, "q=");
Log.i(TAG, "q0=\n");
}
if (q.next()) {
outputText.append( "yes\n" );
@ -59,12 +85,12 @@ public class JavaYap extends Activity
} else {
int i=1;
if (BuildConfig.DEBUG) {
Log.i(TAG, "q=");
Log.i(TAG, "q1= "+vs0.text()+"\n");
}
while (rc = q.next()) {
if (BuildConfig.DEBUG) {
Log.i(TAG, "q=");
Log.i(TAG, "q= "+vs0.text()+"\n");
}
YAPListTerm vs = vs0;