Back to index

texmacs  1.0.7.15
Functions
bibtex_functions.hpp File Reference
#include "analyze.hpp"
#include "convert.hpp"
#include "hashmap.hpp"
#include "hashset.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

string bib_preamble (tree t)
string bib_purify (scheme_tree st)
string bib_prefix (scheme_tree st, int i)
scheme_tree bib_locase (scheme_tree st)
scheme_tree bib_upcase (scheme_tree st)
scheme_tree bib_default (scheme_tree st)
int bib_text_length (scheme_tree st)
bool bib_empty (scheme_tree st, string f)
scheme_tree bib_field (scheme_tree st, string field)
list< stringbib_field_pages (scheme_tree st)
void bib_parse_fields (tree &t)
scheme_tree bib_add_period (scheme_tree st)
scheme_tree bib_upcase_first (scheme_tree st)
hashmap< string, stringbib_strings_dict (tree t)
tree bib_subst_vars (tree t, hashmap< string, string > dict)
tree bib_entries (tree t, tree bib_t)
scheme_tree bib_abbreviate (scheme_tree st, scheme_tree s1, scheme_tree s2)

Function Documentation

Definition at line 768 of file bibtex_functions.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 205 of file bibtex_functions.cpp.

                                {
  tree t= simplify_correct (scheme_tree_to_tree (st));
  char* ch= bib_last_char (t);
  if (ch == 0) return tree_to_scheme_tree (t);
  if (*ch == ',' || *ch == ';') {
    *ch= '.';
    return tree_to_scheme_tree (t);
  }
  else if (*ch != '!' && *ch != '?' && *ch != '.') {
    tree res (CONCAT);
    res << t;
    res << ".";
    return tree_to_scheme_tree (res);
  }
  else return tree_to_scheme_tree (t);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 314 of file bibtex_functions.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool bib_empty ( scheme_tree  st,
string  f 
)

Definition at line 920 of file bibtex_functions.cpp.

                                     {
  return (bib_field (st, f) == "");
}

Here is the call graph for this function:

Here is the caller graph for this function:

tree bib_entries ( tree  t,
tree  bib_t 
)

Definition at line 1049 of file bibtex_functions.cpp.

                                 {
  hashmap<string,string> dict= bib_strings_dict (t);
  tree res= bib_select_entries (t, bib_t);
  return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

scheme_tree bib_field ( scheme_tree  st,
string  field 
)

Definition at line 903 of file bibtex_functions.cpp.

                                         {
  tree t= scheme_tree_to_tree (st);
  if (bib_is_entry (t)) {
    tree doc= t[2];
    for (int i= 0; i<N(doc); i++) {
      if (bib_is_field (doc[i]) && doc[i][0] == field)
        return tree_to_scheme_tree (doc[i][1]);
    }
  }
  return "";
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 300 of file bibtex_functions.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void bib_parse_fields ( tree t)

Definition at line 890 of file bibtex_functions.cpp.

                           {
  string fields;
  int i= 0;
  int nb= bib_get_fields (t, fields);
  array<tree> latex= bib_latex_array (latex_to_tree (parse_latex (fields)));
  if (nb == N(latex)) bib_set_fields (t, latex, i);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 929 of file bibtex_functions.cpp.

                      {
  string pre;
  if (bib_is_preamble (t)) {
    tree doc= t[0];
    for (int i= 0; i<N(doc); i++)
      if (bib_is_latex (doc[i]))
       pre << "\n" << doc[i][0]->label;
  }
  return pre;
}

Here is the call graph for this function:

string bib_prefix ( scheme_tree  st,
int  i 
)

Definition at line 703 of file bibtex_functions.cpp.

                                   {
  tree t= simplify_correct (scheme_tree_to_tree (st));
  string pre;
  int j= i;
  bib_get_prefix (t, pre, j);
  return pre; 
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 612 of file bibtex_functions.cpp.

                            {
  tree t= simplify_correct (scheme_tree_to_tree (st));
  string res;
  bib_purify_tree (t, res);
  return res; 
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 945 of file bibtex_functions.cpp.

                          {
  hashmap<string,string> dict ("");
  dict("acmcs")= "ACM Computing Surveys";
  dict("acta")= "Acta Informatica";
  dict("cacm")= "Communications of the ACM";
  dict("ibmjrd")= "IBM Journal of Research and Development";
  dict("ibmsj")= "IBM Systems Journal";
  dict("ieeese")= "IEEE Transactions on Software Engineering";
  dict("ieeetc")= "IEEE Transactions on Computers";
  dict("ieeetcad")= "IEEE Transactions on Computer-Aided Design of Integrated Circuits";
  dict("ipl")= "Information Processing Letters";
  dict("jacm")= "Journal of the ACM";
  dict("jcss")= "Journal of Computer and System Sciences";
  dict("scp")= "Science of Computer Programming";
  dict("sicomp")= "SIAM Journal on Computing";
  dict("tocs")= "ACM Transactions on Computer Systems";
  dict("tods")= "ACM Transactions on Database Systems";
  dict("tog")= "ACM Transactions on Graphics";
  dict("toms")= "ACM Transactions on Mathematical Software";
  dict("toois")= "ACM Transactions on Office Information Systems";
  dict("toplas")= "ACM Transactions on Programming Languages and Systems";
  dict("tcs")= "Theoretical Computer Science";
  if (L(t) == DOCUMENT) {
    tree str (DOCUMENT);
    for (int i= 0; i<N(t); i++) {
      if (bib_is_string (t[i])) {
        str= t[i][0];
        break;
      }
    }
    for (int i= 0; i<N(str); i++) {
      if (bib_is_assign (str[i])) {
        string key= locase_all (str[i][0]->label);
        tree val= str[i][1];
        if (L(val) == CONCAT) {
          string sval;
          for (int j= 0; j<N(val); j++) {
            if (is_atomic (val[j])) sval << val[j]->label;
            else if (bib_is_var (val[j])) sval << dict[val[j][0]->label];
          }
          dict(key)= sval;
        }
        else if (is_atomic (val))
          dict(key)= val->label;
      }
    }
  }
  return dict;
}

Here is the call graph for this function:

Here is the caller graph for this function:

tree bib_subst_vars ( tree  t,
hashmap< string, string dict 
)

Definition at line 1016 of file bibtex_functions.cpp.

                                                     {
  if (is_atomic (t) || L(t) == CONCAT || bib_is_var (t))
    return tree (copy (bib_subst_str (t, dict)));
  else {
    tree r (L(t), N(t));
    for (int i= 0; i<N(t); i++)
      r[i]= bib_subst_vars (t[i], dict);
    return r;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 671 of file bibtex_functions.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 307 of file bibtex_functions.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 249 of file bibtex_functions.cpp.

                                  {
  tree t= simplify_correct (scheme_tree_to_tree (st));
  char* ch= bib_first_char (t);
  if (ch != 0) *ch= upcase (*ch);
  return tree_to_scheme_tree (t); 
}

Here is the call graph for this function:

Here is the caller graph for this function: