2015-06-18 01:59:07 +01:00
/*************************************************************************
2018-07-10 23:21:19 +01:00
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L . Damas , V . S . Costa and Universidade do Porto 2015 - *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* File : YapLFlagInfo . h * Last rev :
* * mods : * comments : local flag enumeration . *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2015-06-18 01:59:07 +01:00
/** @file YapLFlagInfo.h
2018-04-20 14:59:17 +01:00
@ addtogroup YAPFlags
2018-04-27 13:01:08 +01:00
@ ingroup builtins
@ {
2018-05-20 00:47:27 +01:00
@ enum THREAD_LOCAL_FLAGS Local Flags supported by YAP
@ brief local flags and their values .
2015-06-18 01:59:07 +01:00
*/
2018-05-10 13:11:56 +01:00
START_LOCAL_FLAGS
2019-05-09 12:44:50 +01:00
/**< Allow constructs such as 'Functor( V )'. Functor is parsed as an
atom . The token ` V ` is still understood as a variable .
Originally a SWI - Prolog flag .
*/
YAP_FLAG ( ALLOW_VARIABLE_NAME_AS_FUNCTOR_FLAG , " allow_variable_name_as_functor " , true , booleanFlag , " false " , NULL ) ,
2018-11-14 09:35:24 +00:00
/**< set the system to look for undefined procedures */
2018-07-10 23:21:19 +01:00
YAP_FLAG ( AUTOLOAD_FLAG , " autoload " , true , booleanFlag , " false " , NULL ) ,
2018-10-10 09:39:04 +01:00
2018-11-14 09:35:24 +00:00
/**<`read-only flag, that tells if Prolog is in an inner top-level */
2018-07-10 23:21:19 +01:00
YAP_FLAG ( BREAK_LEVEL_FLAG , " break_level " , true , nat , " 0 " , NULL ) ,
2018-10-10 09:39:04 +01:00
2018-11-14 09:35:24 +00:00
/**<
2018-07-10 23:21:19 +01:00
Predicates compiled with this flag set maintain a counter
on the numbers of proceduree calls and of retries . These counters
are decreasing counters , and they can be used as timers . Three
counters are available :
calls : number of predicate calls since execution started or
since system was reset ; retries : number of retries for predicates
called since execution started or since counters were reset ;
calls_and_retries : count both on predicate calls and
retries . These counters can be used to find out how many calls a
certain goal takes to execute . They can also be force the
computatiom yp stopping .
If ` on ` ` fileerrors ` is ` on ` , if ` off ` ( default )
` fileerrors ` is disabled .
*/
2018-10-10 09:39:04 +01:00
YAP_FLAG ( CALL_COUNTING_FLAG , " call_counting " , true , booleanFlag , " true " ,
NULL ) ,
2019-03-12 10:51:39 +00:00
/**< Indicates YAP is running within the compiler. */
YAP_FLAG ( COMPILING_FLAG , " compiling " , false , booleanFlag ,
" true " , NULL ) ,
2018-11-14 09:35:24 +00:00
/**< support for coding systens, YAP relies on UTF-8 internally.
2018-10-10 09:39:04 +01:00
*/
2018-07-10 23:21:19 +01:00
YAP_FLAG ( ENCODING_FLAG , " encoding " , true , isatom , " utf-8 " , getenc ) ,
2018-10-10 09:39:04 +01:00
/** + what to do if opening a file fails.
*/
YAP_FLAG ( FILEERRORS_FLAG , " fileerrors " , true , booleanFlag , " true " ,
2018-11-14 09:35:24 +00:00
NULL ) ,
2018-07-10 23:21:19 +01:00
2018-11-14 09:35:24 +00:00
/**<
2018-07-10 23:21:19 +01:00
2018-11-14 09:35:24 +00:00
whether native mode or trying to emulate a different
2018-10-10 09:39:04 +01:00
Prolog .
2018-07-10 23:21:19 +01:00
*/
2018-10-10 09:39:04 +01:00
YAP_FLAG ( LANGUAGE_MODE_FLAG , " language_mode " , true , isatom , " yap " ,
NULL ) ,
2019-05-09 12:44:50 +01:00
/**< If true, quoted atoms, string, lists of codes and of chars may extend over several lines, without the need to escape the new-line characters. Otherwise, unquoted line breaks cause a syntax error.
The default was for it to be true , except if in iso mode . YAP - 6.5 changed the default , in order to ensure compatibility .
*/
YAP_FLAG ( MULTILINE_QUOTED_TEXT_FLAG , " multiline_quoted_text " , false , booleanFlag , " false " , NULL ) ,
2019-03-12 10:51:39 +00:00
/**< Show the execution stack in exceptions. */
YAP_FLAG ( STACK_DUMP_ON_ERROR_FLAG , " stack_dump_on_error " , false , booleanFlag ,
2018-11-14 09:35:24 +00:00
" true " , NULL ) ,
2019-03-12 10:51:39 +00:00
/**<
2018-07-10 23:21:19 +01:00
2018-11-14 09:35:24 +00:00
If ` true ` show a stack dump when YAP finds an error . The default is
` off ` .
*/
YAP_FLAG ( STREAM_TYPE_CHECK_FLAG , " stream_type_check " , true , isatom , " loose " ,
2018-07-10 23:21:19 +01:00
NULL ) ,
2018-11-14 09:35:24 +00:00
/** + `syntax_errors`
2015-06-18 01:59:07 +01:00
2018-07-10 23:21:19 +01:00
Control action to be taken after syntax errors while executing read / 1 ,
2015-06-18 01:59:07 +01:00
` read / 2 ` , or ` read_term / 3 ` :
2018-07-10 23:21:19 +01:00
+ ` dec10 `
2015-06-18 01:59:07 +01:00
Report the syntax error and retry reading the term .
2018-07-10 23:21:19 +01:00
+ ` fail `
2015-07-06 11:53:50 +01:00
Report the syntax error and fail .
2018-07-10 23:21:19 +01:00
+ ` error `
2015-07-06 11:53:50 +01:00
Report the syntax error and generate an error ( default ) .
2018-07-10 23:21:19 +01:00
+ ` quiet `
2015-06-18 01:59:07 +01:00
Just fail
2018-07-10 23:21:19 +01:00
*/
2019-03-12 10:51:39 +00:00
YAP_FLAG ( SYNTAX_ERRORS_FLAG , " syntax_errors " , true , synerr , " error " ,
NULL ) ,
/**<
If bound , set the current working or type - in module to the argument ,
which must be an atom . If unbound , unify the argument with the current
working module .
*/
YAP_FLAG ( TYPEIN_MODULE_FLAG , " typein_module " , true , isatom , " user " ,
2018-11-14 09:35:24 +00:00
typein ) ,
2015-06-18 01:59:07 +01:00
2019-01-09 09:32:09 +00:00
2019-03-12 10:51:39 +00:00
2019-01-09 09:32:09 +00:00
/**<
If ` normal ` allow printing of informational and banner messages ,
such as the ones that are printed when consulting . If ` silent `
disable printing these messages . It is ` normal ` by default except if
YAP is booted with the ` - q ` or ` - L ` flag .
*/
YAP_FLAG ( VERBOSE_FLAG , " verbose " , true , isatom , " normal " , NULL ) ,
/**<
If ` true ` allow printing of informational messages when
2019-01-31 11:52:03 +00:00
searching for file names . If ` false ` disable printing these
messages . It is ` false ` by default except if YAP is booted with
the ` - L ` flag .
2019-01-09 09:32:09 +00:00
*/
YAP_FLAG ( VERBOSE_FILE_SEARCH_FLAG , " verbose_file_search " , true , booleanFlag ,
" false " , NULL ) ,
/**<
If ` true ` allow printing of informational messages when
consulting files . If ` false ` disable printing these messages . It
is ` true ` by default except if YAP is booted with the ` - L `
flag .
*/
2019-03-12 10:51:39 +00:00
YAP_FLAG ( VERBOSE_LOAD_FLAG , " verbose_load " , true , booleanFlag , " true " , NULL ) ,
/**<
2019-01-09 09:32:09 +00:00
If the second argument is bound to a stream , set user_error to
this stream . If the second argument is unbound , unify the argument with
the current user_error stream .
By default , the user_error stream is set to a stream
corresponding to the Unix ` stderr ` stream .
The next example shows how to use this flag :
~ ~ ~ { . prolog }
? - open ( ' / dev / null ' , append , Error ,
[ alias ( mauri_tripa ) ] ) .
Error = ' $ stream ' ( 3 ) ? ;
no
? - set_prolog_flag ( user_error , mauri_tripa ) .
close ( mauri_tripa ) .
yes
? -
~ ~ ~
We execute three commands . First , we open a stream in write mode and
give it an alias , in this case ` mauri_tripa ` . Next , we set
user_error to the stream via the alias . Note that after we did so
prompts from the system were redirected to the stream
` mauri_tripa ` . Last , we close the stream . At this point , YAP
automatically redirects the user_error alias to the original
` stderr ` .
*/
2018-11-15 09:18:22 +00:00
YAP_FLAG ( USER_ERROR_FLAG , " user_error " , true , stream , " user_error " ,
set_error_stream ) ,
YAP_FLAG ( USER_INPUT_FLAG , " user_input " , true , stream , " user_input " ,
set_input_stream ) ,
YAP_FLAG ( USER_OUTPUT_FLAG , " user_output " , true , stream , " user_output " ,
set_output_stream ) ,
2018-07-10 23:21:19 +01:00
END_LOCAL_FLAGS
2018-04-27 17:37:42 +01:00
2018-07-10 23:21:19 +01:00
/// @}