infrastructure to eventually support SWI atom table.

This commit is contained in:
Vitor Santos Costa 2009-06-01 15:37:01 -05:00
parent 0bd3c910dd
commit a36c507175
2 changed files with 838 additions and 0 deletions

View File

@ -403,3 +403,811 @@ F UMinus Minus 1
F UPlus Plus 1
F VBar VBar 2
F Var Var 1
A abort "abort"
A aborted "$aborted"
A abs "abs"
A access "access"
A acos "acos"
A agc "agc"
A agc_gained "agc_gained"
A agc_margin "agc_margin"
A agc_time "agc_time"
A alias "alias"
A allow_variable_name_as_functor "allow_variable_name_as_functor"
A alnum "alnum"
A alpha "alpha"
A alternative "alternative"
A and "/\\"
A anonvar "_"
A append "append"
A ar_equals "=:="
A ar_not_equal "=\\="
A argument "argument"
A argumentlimit "argumentlimit"
A ascii "ascii"
A asin "asin"
A assert "assert"
A asserta "asserta"
A at "at"
A at_equals "=@="
A at_exit "at_exit"
A at_larger "@>"
A at_larger_eq "@>="
A at_not_equals "\\=@="
A at_smaller "@<"
A at_smaller_eq "@=<"
A atan "atan"
A atom "atom"
A atom_garbage_collection "atom_garbage_collection"
A atomic "atomic"
A atoms "atoms"
A att "att"
A attributes "attributes"
A attvar "attvar"
A autoload "autoload"
A backquoted_string "backquoted_string"
A backslash "\\"
A backtrace "backtrace"
A bar "|"
A begin "begin"
A binary "binary"
A bind "bind"
A block "block"
A bof "bof"
A bom "bom"
A bool "bool"
A brace_term_position "brace_term_position"
A break "break"
A btree "btree"
A buffer "buffer"
A buffer_size "buffer_size"
A built_in_procedure "built_in_procedure"
A busy "busy"
A byte "byte"
A call "call"
A callable "callable"
A callpred "$callpred"
A canceled "canceled"
A case_sensitive_file_names "case_sensitive_file_names"
A catch "catch"
A ceil "ceil"
A ceiling "ceiling"
A char_type "char_type"
A character "character"
A character_code "character_code"
A character_escapes "character_escapes"
A chars "chars"
A chdir "chdir"
A chmod "chmod"
A choice "choice"
A clause "clause"
A clause_reference "clause_reference"
A close "close"
A close_on_abort "close_on_abort"
A close_option "close_option"
A cm "cm"
A cntrl "cntrl"
A co "co"
A codes "codes"
A collected "collected"
A collections "collections"
A colon ":"
A comma ","
A comments "comments"
A compound "compound"
A context "context"
A context_module "context_module"
A continue "continue"
A core "core"
A core_left "core_left"
A cos "cos"
A cputime "cputime"
A create "create"
A csym "csym"
A csymf "csymf"
A cumulative "cumulative"
A curl "{}"
A current "current"
A current_input "current_input"
A current_output "current_output"
A cut "!"
A cut_call "cut_call"
A cut_exit "cut_exit"
A cut_parent "cut_parent"
A cutted "cut"
A date "date"
A db_reference "db_reference"
A dc_call_prolog "$c_call_prolog"
A dcall "<meta-call>"
A dcall_cleanup "$call_cleanup"
A dcatch "$catch"
A dcut "$cut"
A dde_error "dde_error"
A dde_handle "dde_handle"
A debug "debug"
A debug_on_error "debug_on_error"
A debugger_print_options "debugger_print_options"
A debugger_show_context "debugger_show_context"
A debugging "debugging"
A dec10 "dec10"
A default "default"
A defined "defined"
A delete "delete"
A depth_limit_exceeded "depth_limit_exceeded"
A destroy "destroy"
A detached "detached"
A detect "detect"
A development "development"
A dexit "$exit"
A dforeign_registered "$foreign_registered"
A dgarbage_collect "$garbage_collect"
A digit "digit"
A directory "directory"
A discontiguous "discontiguous"
A div "//"
A divide "/"
A dload "$load"
A dmessage_queue "$message_queue"
A dmutex "$mutex"
A domain_error "domain_error"
A dos "dos"
A dot "."
A dots "dots"
A double_quotes "double_quotes"
A doublestar "**"
A dprof_node "$profile_node"
A dstream "$stream"
A dthread_init "$thread_init"
A dthrow "$throw"
A dtime "$time"
A dwakeup "$wakeup"
A dynamic "dynamic"
A e "e"
A encoding "encoding"
A end "end"
A end_of_file "end_of_file"
A end_of_line "end_of_line"
A end_of_stream "end_of_stream"
A environment "environment"
A eof "eof"
A eof_action "eof_action"
A eof_code "eof_code"
A equal "equal"
A equals "="
A erase "erase"
A erased "erased"
A error "error"
A eval "eval"
A evaluable "evaluable"
A evaluation_error "evaluation_error"
A exception "exception"
A exclusive "exclusive"
A execute "execute"
A exist "exist"
A existence_error "existence_error"
A exit "exit"
A exited "exited"
A exp "exp"
A export "export"
A exports "exports"
A exported "exported"
A expression "expression"
A externals "externals"
A fact "fact"
A factor "factor"
A fail "fail"
A failure_error "failure_error"
A false "false"
A feature "feature"
A file "file"
A file_name "file_name"
A file_name_variables "file_name_variables"
A file_no "file_no"
A flag "flag"
A flag_value "flag_value"
A float "float"
A float_format "float_format"
A float_fractional_part "float_fractional_part"
A float_integer_part "float_integer_part"
A float_overflow "float_overflow"
A float_underflow "float_underflow"
A floor "floor"
A force "force"
A foreign "foreign"
A foreign_function "$foreign_function"
A foreign_return_value "foreign_return_value"
A fork "fork"
A frame "frame"
A frame_attribute "frame_attribute"
A frame_finished "frame_finished"
A frame_reference "frame_reference"
A free_of_attvar "free_of_attvar"
A freeze "freeze"
A full "full"
A functor_name "functor_name"
A functors "functors"
A fx "fx"
A fy "fy"
A garbage_collected "<garbage_collected>"
A garbage_collection "garbage_collection"
A gc "gc"
A gctime "gctime"
A getcwd "getcwd"
A global "global"
A global_shifts "global_shifts"
A global_stack "global_stack"
A globallimit "globallimit"
A globalused "globalused"
A goal "goal"
A goal_expansion "goal_expansion"
A grammar "-->"
A graph "graph"
A gvar "gvar"
A halt "halt"
A has_alternatives "has_alternatives"
A hash "hash"
A hashed "hashed"
A hat "^"
A heap "heap"
A heaplimit "heaplimit"
A heapused "heapused"
A help "help"
A hidden "hidden"
A hide_childs "hide_childs"
A history_depth "history_depth"
A ifthen "->"
A ignore "ignore"
A ignore_ops "ignore_ops"
A imported "imported"
A imported_procedure "imported_procedure"
A index "index"
A indexed "indexed"
A inf "inf"
A inferences "inferences"
A infinite "infinite"
A informational "informational"
A init_file "init_file"
A initialization "initialization"
A input "input"
A inserted_char "inserted_char"
A instantiation_error "instantiation_error"
A int "int"
A int64_t "int64_t"
A int_overflow "int_overflow"
A integer "integer"
A integer_expression "integer_expression"
A interrupt "interrupt"
A io_error "io_error"
A io_mode "io_mode"
A ioctl "ioctl"
A is "is"
A iso "iso"
A iso_latin_1 "iso_latin_1"
A isovar "$VAR"
A join "join"
A jump "jump"
A kernel "kernel"
A key "key"
A larger ">"
A larger_equal ">="
A level "level"
A li "li"
A limit "limit"
A line "line"
A line_count "line_count"
A list "list"
A list_position "list_position"
A listing "listing"
A local "local"
A local_shifts "local_shifts"
A local_stack "local_stack"
A locale "locale"
A locallimit "locallimit"
A localused "localused"
A lock "lock"
A locked "locked"
A log "log"
A log10 "log10"
A long "long"
A low "low"
A lower "lower"
A lsb "lsb"
A lshift "<<"
A main "main"
A mark "mark"
A matches "matches"
A max "max"
A max_arity "max_arity"
A max_dde_handles "max_dde_handles"
A max_depth "max_depth"
A max_files "max_files"
A max_path_length "max_path_length"
A max_size "max_size"
A max_variable_length "max_variable_length"
A memory "memory"
A message "message"
A message_lines "message_lines"
A message_queue "message_queue"
A message_queue_property "message_queue_property"
A meta_argument "meta_argument"
A meta_argument_specifier "meta_argument_specifier"
A meta_predicate "meta_predicate"
A min "min"
A min_free "min_free"
A minus "-"
A mismatched_char "mismatched_char"
A mod "mod"
A mode "mode"
A modify "modify"
A module "module"
A module_property "module_property"
A module_transparent "module_transparent"
A modules "modules"
A msb "msb"
A multifile "multifile"
A mutex "mutex"
A mutex_option "mutex_option"
A mutex_property "mutex_property"
A natural "natural"
A newline "newline"
A nil "[]"
A nlink "nlink"
A no_memory "no_memory"
A nodebug "nodebug"
A non_empty_list "non_empty_list"
A none "none"
A noprofile "noprofile"
A not "not"
A not_equals "\\="
A not_implemented "not_implemented"
A not_less_than_one "not_less_than_one"
A not_less_than_zero "not_less_than_zero"
A not_provable "\\+"
A not_strickt_equals "\\=="
A not_unique "not_unique"
A number "number"
A number_of_clauses "number_of_clauses"
A numbervar_option "numbervar_option"
A numbervars "numbervars"
A occurs_check "occurs_check"
A octet "octet"
A off "off"
A on "on"
A open "open"
A operator "operator"
A operator_priority "operator_priority"
A operator_specifier "operator_specifier"
A optimise "optimise"
A or "\\/"
A order "order"
A output "output"
A pair "pair"
A paren "paren"
A parent "parent"
A parent_goal "parent_goal"
A partial "partial"
A past "past"
A past_end_of_stream "past_end_of_stream"
A pattern "pattern"
A pc "pc"
A period "period"
A permission_error "permission_error"
A pi "pi"
A pipe "pipe"
A plain "plain"
A plus "+"
A popcount "popcount"
A portray "portray"
A position "position"
A posix "posix"
A powm "powm"
A predicate_indicator "predicate_indicator"
A predicates "predicates"
A print "print"
A print_message "print_message"
A priority "priority"
A private_procedure "private_procedure"
A procedure "procedure"
A profile_mode "profile_mode"
A profile_no_cpu_time "profile_no_cpu_time"
A profile_node "profile_node"
A program "program"
A program_counter "program_counter"
A prolog "prolog"
A prompt "|:"
A property "property"
A protocol "protocol"
A prove ":-"
A punct "punct"
A query "?-"
A question_mark "?"
A queue_option "queue_option"
A quiet "quiet"
A quote "quote"
A quoted "quoted"
A radix "radix"
A random "random"
A random_option "random_option"
A rational "rational"
A rationalize "rationalize"
A rdiv "rdiv"
A read "read"
A read_option "read_option"
A readline "readline"
A real_time "real_time"
A receiver "receiver"
A record "record"
A record_position "record_position"
A redefine "redefine"
A redo "redo"
A references "references"
A rem "rem"
A rename "rename"
A report_error "report_error"
A reposition "reposition"
A representation_error "representation_error"
A representation_errors "representation_errors"
A reset "reset"
A resource_error "resource_error"
A resource_handle "resource_handle"
A retry "retry"
A round "round"
A rshift ">>"
A running "running"
A runtime "runtime"
A save_class "save_class"
A save_option "save_option"
A seed "seed"
A seek_method "seek_method"
A select "select"
A semicolon ";"
A separated "separated"
A set "set"
A setup_call_catcher_cleanup "setup_call_catcher_cleanup"
A shared "shared"
A shared_object "shared_object"
A shared_object_handle "shared_object_handle"
A shell "shell"
A sign "sign"
A signal "signal"
A signal_handler "signal_handler"
A silent "silent"
A sin "sin"
A singletons "singletons"
A size "size"
A skip "skip"
A smaller "<"
A smaller_equal "=<"
A softcut "*->"
A source_sink "source_sink"
A space "space"
A spy "spy"
A sqrt "sqrt"
A stack "stack"
A stack_parameter "stack_parameter"
A stack_shifts "stack_shifts"
A stacks "stacks"
A stand_alone "stand_alone"
A star "*"
A start "start"
A stat "stat"
A static_procedure "static_procedure"
A statistics "statistics"
A status "status"
A stderr "stderr"
A stream "stream"
A stream_option "stream_option"
A stream_or_alias "stream_or_alias"
A stream_position "$stream_position"
A stream_property "stream_property"
A strict_equal "=="
A string "string"
A string_position "string_position"
A subterm_positions "subterm_positions"
A suffix "suffix"
A syntax_error "syntax_error"
A syntax_errors "syntax_errors"
A system "system"
A system_error "system_error"
A system_init_file "system_init_file"
A system_thread_id "system_thread_id"
A system_time "system_time"
A tan "tan"
A term "term"
A term_expansion "term_expansion"
A term_position "term_position"
A terminal "terminal"
A terminal_capability "terminal_capability"
A text "text"
A thread "thread"
A thread_cputime "thread_cputime"
A thread_initialization "thread_initialization"
A thread_local "thread_local"
A thread_local_procedure "thread_local_procedure"
A thread_option "thread_option"
A thread_property "thread_property"
A threads "threads"
A threads_created "threads_created"
A throw "throw"
A tilde "~"
A time "time"
A time_stamp "time_stamp"
A timeout "timeout"
A timeout_error "timeout_error"
A timezone "timezone"
A to_lower "to_lower"
A to_upper "to_upper"
A top "top"
A top_level "top_level"
A toplevel "toplevel"
A trace "trace"
A trace_any "trace_any"
A trace_call "trace_call"
A trace_exit "trace_exit"
A trace_fail "trace_fail"
A trace_gc "trace_gc"
A trace_redo "trace_redo"
A traceinterc "prolog_trace_interception"
A tracing "tracing"
A trail "trail"
A trail_shifts "trail_shifts"
A traillimit "traillimit"
A trailused "trailused"
A transparent "transparent"
A transposed_char "transposed_char"
A transposed_word "transposed_word"
A true "true"
A truncate "truncate"
A tty "tty"
A tty_control "tty_control"
A type "type"
A type_error "type_error"
A undefined "undefined"
A undefined_global_variable "undefined_global_variable"
A undefinterc "$undefined_procedure"
A unicode_be "unicode_be"
A unicode_le "unicode_le"
A unify "unify"
A unique "unique"
A univ "=.."
A unknown "unknown"
A unlimited "unlimited"
A unlock "unlock"
A unlocked "unlocked"
A update "update"
A upper "upper"
A user "user"
A user_error "user_error"
A user_input "user_input"
A user_output "user_output"
A utc "UTC"
A utf8 "utf8"
A v "v"
A var "$VAR$"
A variable "variable"
A variable_names "variable_names"
A variables "variables"
A very_deep "very_deep"
A vmi "vmi"
A volatile "volatile"
A wakeup "wakeup"
A warning "warning"
A wchar_t "wchar_t"
A white "white"
A write "write"
A write_attributes "write_attributes"
A write_option "write_option"
A xdigit "xdigit"
A xf "xf"
A xfx "xfx"
A xfy "xfy"
A xml "xml"
A xor "xor"
A xpceref "@"
A yf "yf"
A yfx "yfx"
A yfy "yfy"
A zero_divisor "zero_divisor"
F abs 1
F access 1
F acos 1
F alias 1
F and 2
F ar_equals 2
F ar_not_equal 2
F asin 1
F assert 1
F asserta 1
F atan 1
F atan 2
F atom 1
F att 3
F backslash 1
F bar 2
F block 3
F bom 1
F brace_term_position 3
F break 1
F break 2
F break 3
F buffer 1
F buffer_size 1
F busy 2
F call 1
F callpred 2
F catch 3
F ceil 1
F ceiling 1
F chars 1
F chars 2
F clause 1
F close_on_abort 1
F codes 1
F codes 2
F colon 2
F comma 2
F context 2
F cos 1
F cputime 0
F curl 1
F cut_call 1
F cut_exit 1
F date 9
F dcall 1
F dcut 1
F dde_error 2
F debugging 1
F detached 1
F dexit 2
F dforeign_registered 2
F dgarbage_collect 1
F div 2
F divide 2
F dmessage_queue 1
F dmutex 1
F domain_error 2
F dot 2
F doublestar 2
F dprof_node 1
F dstream 1
F dthread_init 0
F dthrow 1
F dtime 2
F dwakeup 1
F e 0
F encoding 1
F end_of_stream 1
F eof_action 1
F equals 2
F erased 1
F error 2
F eval 1
F evaluation_error 1
F exception 1
F exception 3
F existence_error 2
F exited 1
F exp 1
F exports 1
F fail 0
F failure_error 1
F file 1
F file 4
F file_name 1
F file_no 1
F float 1
F float_fractional_part 1
F float_integer_part 1
F floor 1
F foreign_function 1
F frame 3
F frame_finished 1
F goal_expansion 2
F hat 2
F ifthen 2
F input 0
F integer 1
F interrupt 1
F io_error 2
F is 2
F isovar 1
F larger 2
F larger_equal 2
F line_count 1
F list_position 4
F listing 1
F locked 2
F log 1
F log10 1
F lsb 1
F lshift 2
F nlink 1
F max 2
F max_size 1
F message_lines 1
F min 2
F minus 1
F minus 2
F mod 2
F mode 1
F msb 1
F newline 1
F not_implemented 2
F not_provable 1
F occurs_check 2
F or 2
F output 0
F permission_error 3
F pi 0
F pipe 1
F plus 1
F plus 2
F popcount 1
F portray 1
F position 1
F powm 3
F print 1
F print_message 2
F procedure 2
F prove 1
F prove 2
F punct 2
F random 1
F rational 1
F rationalize 1
F rdiv 2
F rem 2
F reposition 1
F representation_error 1
F representation_errors 1
F resource_error 1
F retry 1
F round 1
F rshift 2
F semicolon 2
F setup_call_catcher_cleanup 4
F shared_object 2
F shell 2
F sign 1
F signal 1
F signal 2
F sin 1
F singletons 1
F size 1
F smaller 2
F smaller_equal 2
F softcut 2
F spy 1
F sqrt 1
F star 2
F status 1
F stream 4
F stream_position 4
F string 1
F string 2
F string_position 2
F syntax_error 1
F syntax_error 3
F tan 1
F term_expansion 2
F term_position 5
F timeout 1
F timeout_error 2
F trace 1
F traceinterc 3
F tracing 1
F true 0
F truncate 1
F tty 1
F type 1
F type_error 2
F undefinterc 4
F var 1
F wakeup 3
F warning 3
F xor 2
F xpceref 1
F dc_call_prolog 0
F strict_equal 2

View File

@ -14,20 +14,34 @@ main :-
file_filter('misc/ATOMS','H/tatoms.h',gen_fields),
file_filter('misc/ATOMS','H/iatoms.h',gen_decl),
file_filter('misc/ATOMS','H/ratoms.h',gen_rcov).
% file_filter('misc/ATOMS','packages/PLStream/natoms.h',gen_swiatoms).
gen_fields(Inp,Out) :-
split(Inp," ",["A",Atom,_,_]), !,
append([" Atom Atom",Atom,"_;\n#define Atom",Atom," Yap_heap_regs->Atom",Atom,"_"],Out).
%gen_fields(Inp,Out) :-
% split(Inp," ",["A",Atom,_]), !,
% append([" Atom Atom_",Atom,"_;\n#define Atom_",Atom," Yap_heap_regs->Atom_",Atom,"_"],Out).
gen_fields(Inp,Out) :-
split(Inp," ",["F",Name,_,_]), !,
append([" Functor Functor",Name,"_;\n#define Functor",Name," Yap_heap_regs->Functor",Name,"_"],Out).
%gen_fields(Inp,Out) :-
% split(Inp," ",["F",Name,Arity]), !,
% append([" Functor Functor_",Name,Arity,"_;\n#define Functor_",Name,Arity," Yap_heap_regs->Functor_",Name,Arity,"_"],Out).
gen_rcov(Inp,Out) :-
split(Inp," ",["A",Atom,_,_]), !,
append([" Atom",Atom," = AtomAdjust(Atom",Atom,");"],Out).
%gen_rcov(Inp,Out) :-
% split(Inp," ",["A",Atom,_]), !,
% append([" Atom_",Atom," = AtomAdjust(Atom_",Atom,");"],Out).
gen_rcov(Inp,Out) :-
split(Inp," ",["F",Functor,_,_]), !,
append([" Functor",Functor," = FuncAdjust(Functor",Functor,");"],Out).
%gen_rcov(Inp,Out) :-
% split(Inp," ",["F",Functor,Arity]), !,
% append([" Functor_",Functor,Arity," = FuncAdjust(Functor_",Functor,Arity,");"],Out).
gen_decl(Inp,Out) :-
split(Inp," ",["A",Atom,"N",String]), !,
@ -35,9 +49,25 @@ gen_decl(Inp,Out) :-
gen_decl(Inp,Out) :-
split(Inp," ",["A",Atom,"F",String]), !,
append([" Atom",Atom," = Yap_FullLookupAtom(",String,");"],Out).
%gen_decl(Inp,Out) :-
% split(Inp," ",["A",Atom,String]), String = [0'",0'$|_], !,
% append([" Atom_",Atom," = Yap_FullLookupAtom(",String,");"],Out).
%gen_decl(Inp,Out) :-
% split(Inp," ",["A",Atom,String]), !,
% append([" Atom_",Atom," = Yap_LookupAtom(",String,");"],Out).
gen_decl(Inp,Out) :-
split(Inp," ",["F",Name,Atom,Arity]), !,
append([" Functor",Name," = Yap_MkFunctor(Atom",Atom,",",Arity,");"],Out).
%gen_decl(Inp,Out) :-
% split(Inp," ",["F",Name,Arity]), !,
% append([" Functor_",Name,Arity," = Yap_MkFunctor(Atom_",Name,",",Arity,");"],Out).
gen_swi(Inp,Out) :-
split(Inp," ",["A",Atom,String]), !,
append(["#define ATOM_",Atom," YAP_AtomToSWIAtom(Atom_",Atom,")"],Out).
gen_swi(Inp,Out) :-
split(Inp," ",["F",Name,Arity]), !,
append(["#define FUNCTOR_",Name,Arity," YAP_FunctorToSWIFunctor(Functor_",Name,Arity,")"],Out).