BTPARSE(1) btparse BTPARSE(1) (NAME) btparse - BibTeX C Perl (SYNOPSIS) #include /* */ void bt_initialize (void); void bt_free_ast (AST *ast); void bt_cleanup (void); /* */ void bt_set_stringopts (bt_metatype_t metatype, btshort options); AST * bt_parse_entry_s (char * entry_text, char * filename, int line, btshort options, boolean * status); AST * bt_parse_entry (FILE * infile, char * filename, btshort options, boolean * status); AST * bt_parse_file (char * filename, btshort options, boolean * overall_status); /* AST */ AST * bt_next_entry (AST * entry_list, AST * prev_entry) AST * bt_next_field (AST *entry, AST *prev, char **name); AST * bt_next_value (AST *head, AST *prev, bt_nodetype_t *nodetype, char **text); bt_metatype_t bt_entry_metatype (AST *entry); char *bt_entry_type (AST *entry); char *bt_entry_key (AST *entry); char *bt_get_text (AST *node); /* */ bt_stringlist * bt_split_list (char * string, char * delim, char * filename, int line, char * description); void bt_free_list (bt_stringlist *list); bt_name * bt_split_name (char * name, char * filename, int line, int name_num); void bt_free_name (bt_name * name); /* */ bt_name_format * bt_create_name_format (char * parts, boolean abbrev_first); void bt_free_name_format (bt_name_format * format); void bt_set_format_text (bt_name_format * format, bt_namepart part, char * pre_part, char * post_part, char * pre_token, char * post_token); void bt_set_format_options (bt_name_format * format, bt_namepart part, boolean abbrev, bt_joinmethod join_tokens, bt_joinmethod join_part); char * bt_format_name (bt_name * name, bt_name_format * format); /* TeX */ bt_tex_tree * bt_build_tex_tree (char * string); void bt_free_tex_tree (bt_tex_tree **top); void bt_dump_tex_tree (bt_tex_tree *node, int depth, FILE *stream); char * bt_flatten_tex_tree (bt_tex_tree *top); /* */ void bt_purify_string (char * string, btshort options); void bt_change_case (char transform, char * string, btshort options); (DESCRIPTION) btparse C BibTeX . (lexical scanner) LR ( PCCTS) (AST) BibTeX. ( BibTeX . BibTeX . .) btparse . Text::BibTeX Perl 5 ( CPAN) . (CONCEPTS AND TERMINOLOGY) btparse, BibTeX -- BibTeX -- . ( BibTeX BibTeX ".bst" BibTeX . : btparse BibTeX .) : @string{and = { and }, joe = "Blow, Joe", john = "John Smith"} @book(ourbook, author = joe # and # john, title = {Our Little Book}) . BibTeX . BibTeX : (top-level) BibTeX . (name) : ! $ & * + - . / : ; < > ? [ ] ^ _ ` | <<>> . BibTeX . : string and. (entry) (@) ( entry type) ({ () . . . (entry type) @ . : string book. (entry metatype) . BibTeX article book inbook << >> (regular entry) . : << >> (macro definition string) <<>> (preamble preamble) <<>> (comment comment). string preamble comment <<>> . (entry delimiters) { } ( ): () . <<>> @ . (entry key) ( .) . : ourbook. . (field) . . : joe author. (field list) . ( ). (compound value) ( <<>>.) (=) (#) . (simple value) . (string) ( << >>.) ( ) ({ }). : {this is a {string} BibTeX {this is a {string}} . ( this is a {string TeX -- BibTeX .) (macro) ( ). btparse . (number) . btparse BibTeX ( ) (AST) . AST btparse . AST . C AST . AST -- . btparse AST . << >> (node type) . @book{mybook, author = "Joe Blow", title = "My Little Book"} "entry" "key" ( ) "field" ( "author" "title") "string" . btparse . btparse (metatype) "entry" . ( ) (comment) . -- . AST bt_traversal . (DATA TYPES AND MACROS) btparse . boolean ( TRUE FALSE) . btparse.h -- boolean HAVE_BOOLEAN typedef boolean btparse.h . (enumeration) : bt_metatype bt_nodetype. AST btparse . ( AST bt_metatype bt_nodetype typedef .) (Entry metatype enum) bt_metatype_t : o BTE_UNKNOWN o BTE_REGULAR o BTE_COMMENT o BTE_PREAMBLE o BTE_MACRODEF << >> . ( @string BTE_MACRODEF @comment @preamble BTE_COMMENT BTE_PREAMBLE BTE_REGULAR .) AST (AST nodetype enum) bt_nodetype : o BTAST_UNKNOWN o BTAST_ENTRY o BTAST_KEY o BTAST_FIELD o BTAST_STRING o BTAST_NUMBER o BTAST_MACRO . AST -- AST . (String processing option macros) BibTeX . / . (bitmap) <<>> . ( .) . : "BTO_CONVERT" <<>> . ( AST BTAST_NUMBER BTAST_STRING . <<>> .) "BTO_EXPAND" . "BTO_PASTE" . "BTO_COLLAPSE" BibTeX. BTO_CONVERT | BTO_EXPAND BTE_REGULAR <<>> : . -- . bt_set_stringopts() bt_parse_*() bt_input bt_postprocess . (USING THE LIBRARY) btparse : #include int main (void) { bt_initialize (); /* */ bt_cleanup (); exit (0); } bt_initialize() ! . btparse bt_initialize() . bt_cleanup() bt_initialize() bt_free_ast() btparse . ( !) (BUGS AND LIMITATIONS) btparse PCCTS 1.x . (thread safety) -- -- . ANTLR 2.0 ( PCCTS) . PCCTS : ( ) . . . btparse . (segmentation fault) (bus error) . ( ) . (bt_free_ast() bt_cleanup()) . (SEE ALSO) BibTeX bt_input . bt_traversal . bt_postprocess . btparse bt_strings . btparse bt_macros . BibTeX btparse bt_split_names . bt_format_names . BibTeX: bt_misc. bt_language . (AUTHOR) Greg Ward (COPYRIGHT) Copyright (c) 1996-97 by Gregory P. Ward. (GNU Library General Public License) ( ) . . . : Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (AVAILABILITY) btOOL btparse ( ) : http://starship.python.net/~gward/btOOL Text::BibTeX ( btparse ) . Text::BibTeX btparse . CTAN ( http://www.ctan.org/tex-archive) CPAN ( http://www.cpan.org) . CTAN biblio/bibtex/utils/btOOL CPAN authors/Greg_Ward . : http://www.ctan.org/tex-archive/biblio/bibtex/utils/btOOL http://www.cpan.org/authors/Greg_Ward Text::BibTeX btparse -- CTAN CPAN (mirrors) . btparse, version 0.91 2025-07-14 BTPARSE(1)