print More...
Go to the source code of this file.
Macros | |
#define | COMMA_PREC ((commasym->op_data)?(commasym->op_data->precedence):0) |
#define | COLON_PREC ((colonsym->op_data)?(colonsym->op_data->precedence):0) |
Functions | |
void | init_print () |
init_print More... | |
char * | heap_nice_name () |
heap_nice_name More... | |
GENERIC | unique_name () |
unique_name More... | |
long | str_to_int (char *s) |
str_to_int More... | |
void | print_bin (long b) |
print_bin More... | |
void | print_code (FILE *s, ptr_int_list c) |
print_code More... | |
void | print_operator_kind (FILE *s, long kind) |
print_operator_kind More... | |
void | check_pointer (ptr_psi_term p) |
check_pointer More... | |
void | go_through_tree (ptr_node t) |
go_through_tree More... | |
void | go_through (ptr_psi_term t) |
go_through More... | |
void | insert_variables (ptr_node vars, long force) |
insert_variables More... | |
void | forbid_variables (ptr_node n) |
void | prettyf_inner (char *s, long q, char c) |
prettyf_inner More... | |
long | starts_nonlower (char *s) |
starts_nonlower More... | |
long | has_non_alpha (char *s) |
has_non_alpha More... | |
long | all_symbol (char *s) |
all_symbol More... | |
long | is_integer (char *s) |
is_integer More... | |
long | no_quote (char *s) |
no_quote More... | |
void | prettyf (char *s) |
prettyf More... | |
void | prettyf_quoted_string (char *s) |
prettyf_quoted_string More... | |
void | prettyf_quote (char *s) |
prettyf_quote More... | |
void | end_tab () |
end_tab More... | |
void | mark_tab (ptr_tab_brk t) |
mark_tab More... | |
void | new_tab (ptr_tab_brk *t) |
new_tab More... | |
long | strpos (long pos, char *str) |
strpos More... | |
void | work_out_length () |
work_out_length More... | |
long | count_features (ptr_node t) |
count_features More... | |
long | check_legal_cons (ptr_psi_term t, ptr_definition t_type) |
check_legal_cons More... | |
void | pretty_list (ptr_psi_term t, long depth) |
pretty_list More... | |
void | pretty_tag_or_psi_term (ptr_psi_term p, long sprec, long depth) |
pretty_tag_or_psi_term More... | |
long | check_opargs (ptr_node n) |
check_opargs More... | |
long | opcheck (ptr_psi_term t, long *prec, long *type) |
opcheck More... | |
long | pretty_psi_with_ops (ptr_psi_term t, long sprec, long depth) |
pretty_psi_with_ops More... | |
void | pretty_psi_term (ptr_psi_term t, long sprec, long depth) |
pretty_psi_term More... | |
void | do_pretty_attr (ptr_node t, ptr_tab_brk tab, long *cnt, long two, long depth) |
do_pretty_attr More... | |
long | two_or_more (ptr_node t) |
two_or_more More... | |
void | pretty_attr (ptr_node t, long depth) |
pretty_attr More... | |
void | pretty_output () |
pretty_output More... | |
void | pretty_variables (ptr_node n, ptr_tab_brk tab) |
pretty_variables More... | |
long | print_variables (long printflag) |
print_variables More... | |
void | write_attributes (ptr_node n, ptr_tab_brk tab) |
write_attributes More... | |
void | listing_pred_write (ptr_node n, long fflag) |
listing_pred_write More... | |
void | pred_write (ptr_node n) |
pred_write More... | |
void | main_pred_write (ptr_node n) |
main_pred_write More... | |
void | display_psi_stdout (ptr_psi_term t) |
display_psi_stdout More... | |
void | display_psi_stderr (ptr_psi_term t) |
display_psi_stderr More... | |
void | display_psi_stream (ptr_psi_term t) |
display_psi_stream More... | |
void | display_psi (FILE *s, ptr_psi_term t) |
display_psi More... | |
void | main_display_psi_term (ptr_psi_term t) |
main_display_psi_term More... | |
void | display_couple (ptr_psi_term u, char *s, ptr_psi_term v) |
display_couple More... | |
void | print_resid_message (ptr_psi_term t, ptr_resid_list r) |
print_resid_message More... | |
Variables | |
long | print_depth =PRINT_DEPTH |
long | indent =FALSE |
long | const_quote =TRUE |
long | write_resids =FALSE |
long | write_canon =FALSE |
long | write_stderr =FALSE |
long | write_corefs =TRUE |
long | page_width =PAGE_WIDTH |
long | display_persistent =FALSE |
char * | no_name ="pointer" |
char * | name ="symbol" |
char | seg_format [PRINT_POWER+4] |
item | pretty_things [PRETTY_SIZE] |
static long | listing_flag |
static long | func_flag |
Definition in file print.c.
#define COLON_PREC ((colonsym->op_data)?(colonsym->op_data->precedence):0) |
#define COMMA_PREC ((commasym->op_data)?(commasym->op_data->precedence):0) |
long all_symbol | ( | char * | s | ) |
long check_legal_cons | ( | ptr_psi_term | t, |
ptr_definition | t_type | ||
) |
check_legal_cons
t | - ptr_psi_term t |
t_type | - ptr_definition t_type |
CHECK_LEGAL_CONS(t,t_type) Check that T is of type T_TYPE, that it has exactly the attributes '1' and '2' and that the 2nd is either nil or also long check_legal_cons(t,t_type)
Definition at line 713 of file print.c.
References wl_psi_term::attr_list, count_features(), FEATCMP, find(), one, two, and wl_psi_term::type.
long check_opargs | ( | ptr_node | n | ) |
check_opargs
n | - ptr_node n |
Routines to handle printing of operators. The main routine is pretty_psi_with_ops, which is called in pretty_psi_term.
Check arguments of a potential operator. Returns existence of arguments 1 and 2 in low two bits of result. If only argument "1" exists, returns 1. If only arguments "1" and "2" exist, returns 3. Existence of any other arguments causes third bit to be set as well.
Definition at line 887 of file print.c.
References featcmp(), wl_node::key, wl_node::left, and wl_node::right.
void check_pointer | ( | ptr_psi_term | p | ) |
check_pointer
p | - ptr_psi_term p |
CHECK_POINTER(p) Count the number of times address P has been encountered in the current psi-term being printed. If it is more than once then a tag will have to be used. If P has not already been seen, then explore the psi_term it points to.
Definition at line 233 of file print.c.
References wl_node::data, deref_ptr, find(), go_through(), heap_insert(), INTCMP, no_name, NULL, and pointer_names.
long count_features | ( | ptr_node | t | ) |
count_features
t | - ptr_node t |
COUNT_FEATURES(t) Return the number of features of a tree.
Definition at line 690 of file print.c.
References wl_node::left, and wl_node::right.
void display_couple | ( | ptr_psi_term | u, |
char * | s, | ||
ptr_psi_term | v | ||
) |
display_couple
u | - ptr_psi_term u |
s | - char *s |
v | - ptr_psi_term v |
DISPLAY_COUPLE(u,s,v) Print a couple of psi-terms (u,v) with the correct co-referencing. Print string S in between.
Definition at line 1643 of file print.c.
References buffer, check_pointer(), const_quote, end_tab(), FALSE, gen_sym_counter, heap_pointer, indent, indx, insert_variables(), listing_flag, mark_tab(), MAX_PRECEDENCE, new_tab(), NULL, output_stream, pointer_names, pretty_output(), pretty_tag_or_psi_term(), pretty_things, prettyf(), printed_pointers, TRUE, var_tree, work_out_length(), write_canon, and write_resids.
void display_psi | ( | FILE * | s, |
ptr_psi_term | t | ||
) |
display_psi
s | - FILE *s |
t | - ptr_psi_term t |
DISPLAY_PSI(stream,t) Print the psi_term T to the given stream.
Definition at line 1579 of file print.c.
References main_display_psi_term(), and outfile.
void display_psi_stderr | ( | ptr_psi_term | t | ) |
display_psi_stderr
t | - ptr_psi_term t |
DISPLAY_PSI_STDERR(t) Print the psi_term T to stderr as simply as possible (no indenting).
Definition at line 1550 of file print.c.
References main_display_psi_term(), and outfile.
void display_psi_stdout | ( | ptr_psi_term | t | ) |
display_psi_stdout
t | - ptr_psi_term t |
DISPLAY_PSI_STDOUT(t) Print the psi_term T to stdout as simply as possible (no indenting).
Definition at line 1536 of file print.c.
References main_display_psi_term(), and outfile.
void display_psi_stream | ( | ptr_psi_term | t | ) |
display_psi_stream
t | - ptr_psi_term t |
DISPLAY_PSI_STREAM(t) Print the psi_term T to output_stream as simply as possible (no indenting).
Definition at line 1564 of file print.c.
References main_display_psi_term(), outfile, and output_stream.
void do_pretty_attr | ( | ptr_node | t, |
ptr_tab_brk | tab, | ||
long * | cnt, | ||
long | two, | ||
long | depth | ||
) |
do_pretty_attr
t | - ptr_node t |
tab | - ptr_tab_brk tab |
cnt | - long *cnt |
two | - long two |
depth | - long depth |
DO_PRETTY_ATTR(t,tab,cnt,two,depth) Pretty print the attribute tree T at position TAB.
CNT is what the value of the first integer label should be, so that "p(1=>a,2=>b)" is printed "p(a,b)" but "p(2=>a,3=>b)" is printed as "p(2 => a,3 => b)".
Definition at line 1199 of file print.c.
References COMMA_PREC, wl_node::data, display_modules, extract_module_from_name(), wl_node::key, wl_node::left, mark_tab(), wl_module::module_name, pretty_tag_or_psi_term(), prettyf(), prettyf_quote(), wl_node::right, str_to_int(), and strip_module_name().
void end_tab | ( | ) |
end_tab
END_TAB() Mark the end of an item. Copy the item's string into global space and point to the next item.
Definition at line 554 of file print.c.
References buffer, heap_alloc(), indent, indx, and wl_item::str.
void forbid_variables | ( | ptr_node | n | ) |
FORBID_VARIABLES This inserts the value of the dereferenced variables into the PRINTED_POINTERS tree, so that they will never be printed as NAME:value inside a psi-term. Each variable is printed as NAME = VALUE by the PRINT_VARIABLES routine.
Definition at line 334 of file print.c.
References wl_node::data, deref_ptr, heap_insert(), INTCMP, wl_node::key, wl_node::left, printed_pointers, and wl_node::right.
void go_through | ( | ptr_psi_term | t | ) |
go_through
t | - ptr_psi_term t |
GO_THROUGH(t) This routine goes through all the sub_terms of psi_term T to determine which pointers need to have names given to them for printing because they are referred to elsewhere. T is a dereferenced psi_term.
Definition at line 282 of file print.c.
References wl_psi_term::attr_list, and go_through_tree().
void go_through_tree | ( | ptr_node | t | ) |
go_through_tree
t | - ptr_node t |
GO_THROUGH_TREE(t) Explore all the pointers in the attribute tree T. Pointers that occur more than once will need a tag.
Definition at line 258 of file print.c.
References check_pointer(), wl_node::data, wl_node::left, and wl_node::right.
long has_non_alpha | ( | char * | s | ) |
char* heap_nice_name | ( | ) |
heap_nice_name
Generate a nice-looking new variable name.
Definition at line 63 of file print.c.
References gen_sym_counter, heap_copy_string(), perr(), and STRLEN.
void init_print | ( | ) |
init_print
Initialize size of single segment of split printing. Wild_Life integers are represented as REALS, and therefore can have higher precision than the machine integers. They will be printed in segments.
Definition at line 52 of file print.c.
References PRINT_POWER, and seg_format.
void insert_variables | ( | ptr_node | vars, |
long | force | ||
) |
insert_variables
vars | - ptr_node vars |
force | - long force |
INSERT_VARIABLES(vars,force) This routine gives the name of the query variable to the corresponding pointer in the POINTER_NAMES. If FORCE is TRUE then variables will be printed as TAGS, even if not referred to elsewhere.
Definition at line 308 of file print.c.
References wl_node::data, deref_ptr, find(), INTCMP, wl_node::key, wl_node::left, pointer_names, and wl_node::right.
long is_integer | ( | char * | s | ) |
void listing_pred_write | ( | ptr_node | n, |
long | fflag | ||
) |
listing_pred_write
n | - ptr_node n |
fflag | - long fflag |
For the listing built-in
Definition at line 1438 of file print.c.
References const_quote, FALSE, func_flag, indent, listing_flag, main_pred_write(), outfile, output_stream, print_depth, PRINT_DEPTH, TRUE, write_canon, write_corefs, write_resids, and write_stderr.
void main_display_psi_term | ( | ptr_psi_term | t | ) |
main_display_psi_term
t | - ptr_psi_term t |
Main loop for previous two entry points
Definition at line 1593 of file print.c.
References buffer, const_quote, deref_ptr, end_tab(), FALSE, gen_sym_counter, go_through(), heap_pointer, indent, indx, insert_variables(), listing_flag, mark_tab(), MAX_PRECEDENCE, new_tab(), NULL, pointer_names, pretty_output(), pretty_tag_or_psi_term(), pretty_things, printed_pointers, TRUE, var_tree, work_out_length(), write_canon, and write_resids.
void main_pred_write | ( | ptr_node | n | ) |
main_pred_write
n | - ptr_node n |
Definition at line 1484 of file print.c.
References buffer, check_pointer(), wl_node::data, end_tab(), FALSE, gen_sym_counter, go_through_tree(), heap_pointer, indent, indx, insert_variables(), wl_node::left, mark_tab(), MAX_PRECEDENCE, new_tab(), NULL, pointer_names, pretty_output(), pretty_tag_or_psi_term(), pretty_things, printed_pointers, wl_node::right, var_tree, work_out_length(), write_attributes(), and write_corefs.
void mark_tab | ( | ptr_tab_brk | t | ) |
mark_tab
t | - ptr_tab_brk t |
MARK_TAB(t) Mark a tabbing position T. Make the current item point to tabbing position T.
Definition at line 573 of file print.c.
References end_tab(), indx, and wl_item::tab.
void new_tab | ( | ptr_tab_brk * | t | ) |
new_tab
t | - ptr_tab_brk *t |
NEW_TAB(t) Create a new tabulation mark T.
Definition at line 587 of file print.c.
References FALSE, and HEAP_ALLOC.
long no_quote | ( | char * | s | ) |
long opcheck | ( | ptr_psi_term | t, |
long * | prec, | ||
long * | type | ||
) |
opcheck
t | - ptr_psi_term t |
prec | - long *prec |
type | - long *type) |
Get information about an operator. If t is an operator with the correct arguments, return one of {INFIX, PREFIX, POSTFIX} and also its precedence and type. If t is not an operator, or it has wrong arguments, return NOTOP and prec=0.
Definition at line 913 of file print.c.
References wl_psi_term::attr_list, check_opargs(), fx, fy, INFIX, wl_operator_data::next, NOTOP, NULL, wl_definition::op_data, POSTFIX, wl_operator_data::precedence, PREFIX, wl_psi_term::type, xf, xfx, xfy, yf, and yfx.
void pred_write | ( | ptr_node | n | ) |
pred_write
n | - ptr_node n |
PRED_WRITE(n) N is an attribute tree to be printed in one lump. This is called by WRITE.
For all write builtins I.e: write, writeq, pretty_write, pretty_writeq, write_err, writeq_err.
Definition at line 1469 of file print.c.
References FALSE, listing_flag, main_pred_write(), outfile, output_stream, and write_stderr.
void pretty_attr | ( | ptr_node | t, |
long | depth | ||
) |
pretty_attr
t | - ptr_node t |
depth | - long depth |
PRETTY_ATTR(t,depth) Pretty print the attributes. This calls DO_PRETTY_ATTR which does the real work.
Definition at line 1273 of file print.c.
References do_pretty_attr(), new_tab(), prettyf(), and two_or_more().
void pretty_list | ( | ptr_psi_term | t, |
long | depth | ||
) |
pretty_list
t | - ptr_psi_term t |
depth | - long depth |
PRETTY_LIST(t,depth) Pretty print a list. On entry we know that T is a legal CONS pair, so we can immediately print the opening bracket etc...
Definition at line 734 of file print.c.
References alist, wl_psi_term::attr_list, check_legal_cons(), COMMA_PREC, wl_node::data, deref_ptr, disj_nil, disjunction, DOTDOT, equal_types, FALSE, find(), get_two_args(), INTCMP, wl_definition::keyword, mark_tab(), MAX_PRECEDENCE, new_tab(), nil, overlap_type(), pointer_names, pretty_symbol(), pretty_tag_or_psi_term(), prettyf(), print_depth, TRUE, and wl_psi_term::type.
void pretty_output | ( | ) |
pretty_output
PRETTY_OUTPUT() Final output of all these pretty things which have been built up.
Definition at line 1293 of file print.c.
References wl_tab_brk::broken, wl_tab_brk::column, indx, outfile, wl_tab_brk::printed, wl_item::str, wl_item::tab, and TRUE.
void pretty_psi_term | ( | ptr_psi_term | t, |
long | sprec, | ||
long | depth | ||
) |
pretty_psi_term
t | - ptr_psi_term t |
sprec | - long sprec |
depth | - long depth |
PRETTY_PSI_TERM(t,sprec,depth) Pretty print a psi_term T with sugar for lists.
Definition at line 1058 of file print.c.
References wl_goal::aaaa_1, alist, wl_psi_term::attr_list, check_legal_cons(), cut, deref_ptr, disj_nil, disjunction, display_persistent, DOTDOT, eof, equal_types, FALSE, wl_residuation::goal, heap_pointer, integer, wl_definition::keyword, wl_residuation::next, nil, wl_goal::pending, pretty_attr(), pretty_list(), pretty_psi_with_ops(), pretty_quote_symbol(), pretty_symbol(), prettyf(), prettyf_quoted_string(), print_depth, PRINT_POWER, PRINT_SPLIT, quoted_string, REAL, real, wl_psi_term::resid, seg_format, stream, STRLEN, sub_type(), sys_bytedata, wl_psi_term::type, wl_psi_term::value_3, WL_MAXINT, and write_canon.
long pretty_psi_with_ops | ( | ptr_psi_term | t, |
long | sprec, | ||
long | depth | ||
) |
pretty_psi_with_ops
t | - ptr_psi_term t |
sprec | - long sprec |
depth | - long depth |
Write an expression with its operators. Return TRUE iff the arguments of t are written here (i.e. t was indeed a valid operator, and is therefore taken care of here).
Definition at line 949 of file print.c.
References wl_psi_term::attr_list, deref_ptr, FALSE, func_flag, fx, fy, get_two_args(), INFIX, wl_definition::keyword, listing_flag, MAX_PRECEDENCE, opcheck(), POSTFIX, PREFIX, pretty_quote_symbol(), pretty_tag_or_psi_term(), prettyf(), wl_keyword::symbol, TRUE, wl_psi_term::type, write_canon, xf, xfx, xfy, yf, and yfx.
void pretty_tag_or_psi_term | ( | ptr_psi_term | p, |
long | sprec, | ||
long | depth | ||
) |
pretty_tag_or_psi_term
p | - ptr_psi_term p |
sprec | - long sprec |
depth | - long depth |
PRETTY_TAG_OR_PSI_TERM(p,depth) Print a psi-term, but first precede it with the appropriate TAG. Don't reprint the same psi-term twice.
Definition at line 834 of file print.c.
References COLON_PREC, wl_node::data, deref_ptr, DOTDOT, FALSE, find(), heap_insert(), INTCMP, is_top, no_name, NULL, pointer_names, pretty_psi_term(), prettyf(), printed_pointers, and unique_name().
void pretty_variables | ( | ptr_node | n, |
ptr_tab_brk | tab | ||
) |
pretty_variables
n | - ptr_node n |
tab | - ptr_tab_brk tab |
PRETTY_VARIABLES(n,tab) Pretty print the variables at position TAB.
Definition at line 1318 of file print.c.
References wl_node::data, deref_ptr, eqsym, find(), INTCMP, wl_node::key, wl_node::left, mark_tab(), MAX_PRECEDENCE, wl_definition::op_data, opcheck(), wl_operator_data::precedence, pretty_psi_term(), prettyf(), printed_pointers, and wl_node::right.
void prettyf | ( | char * | s | ) |
prettyf
s | - char *s |
PRETTYF(s) This prints the string S into the BUFFER.
Definition at line 496 of file print.c.
References FALSE, and prettyf_inner().
void prettyf_inner | ( | char * | s, |
long | q, | ||
char | c | ||
) |
prettyf_inner
s | - char *s |
q | - long q |
c | - char c the quote character |
PRINTING ROUTINES.
These routines allow the correct printing in minimal form of a set of possibly cyclic psi-terms with coreferences from one to another.
First the term to be printed is explored to locate any cyclic terms or coreferences. Then is printed into memory where is it formatted to fit within PAGE_WIDTH of the output page. Then it is effectively printed to the output stream.
Printing into memory involves the use of an array containing a TAB position on which to align things then a string to print. The routine WORK_OUT_LENGTH tries (by trial and error) to print the psi_term into PAGE_WIDTH columns by inserting line feeds whereever possible
Does the work of prettyf and prettyf_quote The q argument is a flag telling whether to quote or not.
Definition at line 374 of file print.c.
References buffer, indent, and outfile.
void prettyf_quote | ( | char * | s | ) |
prettyf_quote
s | - char *s |
PRETTYF_QUOTE(s) This prints the string S into the buffer. S is surrounded by quotes if: (1) const_quote==TRUE, and (2) S does not represent an integer, and (2) S contains a non-alphanumeric character or starts with a non-lowercase character, and (3) if S is longer than one character, it is not true that S has only non-SINGLE SYMBOL characters (in that case, S does not need quotes),and (4) if S has only one character, it is a single space or underscore. When S is surrounded by quotes, a quote inside S is printed as two quotes.
Definition at line 529 of file print.c.
References const_quote, no_quote(), and prettyf_inner().
void prettyf_quoted_string | ( | char * | s | ) |
prettyf_quoted_string
s | - char *s |
Definition at line 507 of file print.c.
References const_quote, and prettyf_inner().
void print_bin | ( | long | b | ) |
print_bin
b | - long b |
PRINT_BIN(b) Print the integer B under binary format (currently 26 is printed **-*-). This is used to print the binary codes used in type encryption.
Definition at line 147 of file print.c.
References INT_SIZE, and outfile.
void print_code | ( | FILE * | s, |
ptr_int_list | c | ||
) |
print_code
s | - FILE *s |
c | - ptr_int_list c |
PRINT_CODE(s,c) Print a binary code C to a stream s (as used in type encoding).
Definition at line 167 of file print.c.
References wl_int_list::next, NOT_CODED, outfile, print_bin(), and wl_int_list::value_1.
void print_operator_kind | ( | FILE * | s, |
long | kind | ||
) |
print_operator_kind
s | - FILE *s |
kind | - long kind |
PRINT_OPERATOR_KIND(s,kind) Print the kind of an operator.
Definition at line 192 of file print.c.
References fx, fy, xf, xfx, xfy, yf, and yfx.
void print_resid_message | ( | ptr_psi_term | t, |
ptr_resid_list | r | ||
) |
print_resid_message
t | - ptr_psi_term t |
r | - ptr_resid_list r |
PRINT_RESID_MESSAGE This is called in trace mode to print the residuated goal along with the RV set.
Definition at line 1690 of file print.c.
References buffer, check_pointer(), const_quote, end_tab(), FALSE, gen_sym_counter, heap_pointer, indent, indx, insert_variables(), listing_flag, mark_tab(), MAX_PRECEDENCE, new_tab(), wl_resid_list::next, NULL, outfile, pointer_names, pretty_tag_or_psi_term(), pretty_things, prettyf(), printed_pointers, TRUE, wl_resid_list::var, var_tree, write_canon, and write_resids.
long print_variables | ( | long | printflag | ) |
print_variables
printflag | - long printflag |
PRINT_VARIABLES This prints all the query variables. Symbols generated to print one variable are coherent with those used in other variables. Returns TRUE iff the set of query variables is nonempty.
Definition at line 1368 of file print.c.
References buffer, const_quote, end_tab(), FALSE, forbid_variables(), gen_sym_counter, go_through_tree(), heap_pointer, indent, indx, insert_variables(), listing_flag, mark_tab(), new_tab(), NULL, outfile, output_stream, pointer_names, pretty_output(), pretty_things, pretty_variables(), prettyf(), printed_pointers, TRUE, var_tree, work_out_length(), write_canon, and write_resids.
long starts_nonlower | ( | char * | s | ) |
long str_to_int | ( | char * | s | ) |
long strpos | ( | long | pos, |
char * | str | ||
) |
strpos
pos | - long pos |
str | - char *str |
Utility to correctly handle '
' inside strings being printed: What is the column after printing str, when the starting position is pos? Same as strlen, except that the length count starts with pos and
resets it.
long two_or_more | ( | ptr_node | t | ) |
two_or_more
t | - ptr_node t |
Return true if number of attributes is greater than 1
Definition at line 1254 of file print.c.
References FALSE, wl_node::left, wl_node::right, and TRUE.
GENERIC unique_name | ( | ) |
unique_name
Make sure that the new variable name does not exist in the var_tree. (This situation should be rare.) Time to print a term is proportional to product of var_tree size and number of tags in the term. This may become large in pathological cases.
Definition at line 99 of file print.c.
References find(), heap_nice_name(), STRCMP, and var_tree.
void work_out_length | ( | ) |
work_out_length
WORK_OUT_LENGTH() Calculate the number of blanks before each tabulation. Insert line feeds until it all fits into PAGE_WIDTH columns. This is done by a trial and error mechanism.
Definition at line 626 of file print.c.
References wl_tab_brk::broken, wl_tab_brk::column, FALSE, indx, NULL, page_width, wl_tab_brk::printed, wl_item::str, strpos(), wl_item::tab, and TRUE.
void write_attributes | ( | ptr_node | n, |
ptr_tab_brk | tab | ||
) |
write_attributes
n | - ptr_node n |
tab | - ptr_tab_brk tab |
WRITE_ATTRIBUTES(n) Used by all versions of the built-in predicate write, and by the built-in predicate listing.
Definition at line 1419 of file print.c.
References wl_node::data, wl_node::left, mark_tab(), MAX_PRECEDENCE, pretty_tag_or_psi_term(), and wl_node::right.
long page_width =PAGE_WIDTH |
item pretty_things[PRETTY_SIZE] |
long print_depth =PRINT_DEPTH |
char seg_format[PRINT_POWER+4] |