Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

SymbolTable Class Reference

tracks names and functions needed to parse a selection for the given class. More...

#include <SymbolTable.h>

List of all members.

Public Methods

 SymbolTable (VMDApp *vmdapp)
 ~SymbolTable (void)
ParseTreeparse (const char *seltext)
 parse selection text, return a new ParseTree on success, NULL on error. More...

void add_keyword (const char *visible, SymbolTableElement::int_fctn get, SymbolTableElement::set_int_fctn set)
void add_keyword (const char *visible, SymbolTableElement::double_fctn get, SymbolTableElement::set_double_fctn set)
void add_keyword (const char *visible, SymbolTableElement::string_fctn get, SymbolTableElement::set_string_fctn set)
void add_singleword (const char *visible, SymbolTableElement::single_fctn get, SymbolTableElement::set_single_fctn set)
void add_stringfctn (const char *visible, SymbolTableElement::stringfctn_fctn get)
void add_cfunction (const char *visible, c_ddfunc fctn)
 Register C functions that take a double and return a double as atom selection functions. Note: These functions must return the same output for given input. Functions like rand() will break some optimizations in the atom selection code otherwise. More...

int find_attribute (const char *attrib)
 find keyword/function matching the name and return function index, or -1. More...

int is_changeable (int fctnidx)
 returns '1' if the variable can be changed/ modified. More...

int num_custom_singleword ()
 Query what custom singlewords have been defined. Note: these include those have been deleted, because the implementation of remove_custom only sets the string to "". Text API's will want to only return the strings that have nonzero length. More...

const char * custom_singleword_name (int)
 Return name with given index, or NULL if not defined. More...

int add_custom_singleword (const char *name, const char *macro)
 add a new singleword macro. More...

const char * get_custom_singleword (const char *name)
 get the macro for the given singleword. More...

int remove_custom_singleword (const char *name)
 delete the given singleword macro. More...


Public Attributes

VMDAppapp
NameList< SymbolTableElement * > fctns


Detailed Description

tracks names and functions needed to parse a selection for the given class.

Definition at line 124 of file SymbolTable.h.


Constructor & Destructor Documentation

SymbolTable::SymbolTable VMDApp   vmdapp [inline]
 

Definition at line 133 of file SymbolTable.h.

SymbolTable::~SymbolTable void   
 

Definition at line 32 of file SymbolTable.C.

References NameList< char * >::data, NameList< SymbolTableElement * >::data, fctns, NameList< char * >::num, NameList< SymbolTableElement * >::num, and num.


Member Function Documentation

void SymbolTable::add_cfunction const char *    visible,
c_ddfunc    fctn
[inline]
 

Register C functions that take a double and return a double as atom selection functions. Note: These functions must return the same output for given input. Functions like rand() will break some optimizations in the atom selection code otherwise.

Definition at line 207 of file SymbolTable.h.

References NameList::add_name, and c_ddfunc.

Referenced by atomSelParser_init.

int SymbolTable::add_custom_singleword const char *    name,
const char *    macro
 

add a new singleword macro.

Definition at line 65 of file SymbolTable.C.

References NameList< char * >::add_name, add_singleword, atomsel_custom_singleword, NameList< char * >::data, find_attribute, ParseTree::find_recursion, NameList< char * >::name, NULL, parse, NameList< char * >::set_data, stringdup, and NameList< char * >::typecode.

Referenced by make_tcl_atomsel, parseAtomselMacros, and py_addmacro.

void SymbolTable::add_keyword const char *    visible,
SymbolTableElement::string_fctn    get,
SymbolTableElement::set_string_fctn    set
[inline]
 

Definition at line 166 of file SymbolTable.h.

References NameList::add_name, NameList::data, NameList::set_data, SymbolTableElement::set_string_fctn, SymbolTableElement::string_fctn, and NameList::typecode.

void SymbolTable::add_keyword const char *    visible,
SymbolTableElement::double_fctn    get,
SymbolTableElement::set_double_fctn    set
[inline]
 

Definition at line 154 of file SymbolTable.h.

References NameList::add_name, NameList::data, SymbolTableElement::double_fctn, NameList::set_data, SymbolTableElement::set_double_fctn, and NameList::typecode.

void SymbolTable::add_keyword const char *    visible,
SymbolTableElement::int_fctn    get,
SymbolTableElement::set_int_fctn    set
[inline]
 

Definition at line 142 of file SymbolTable.h.

References NameList::add_name, NameList::data, SymbolTableElement::int_fctn, NameList::set_data, SymbolTableElement::set_int_fctn, and NameList::typecode.

Referenced by atomSelParser_init.

void SymbolTable::add_singleword const char *    visible,
SymbolTableElement::single_fctn    get,
SymbolTableElement::set_single_fctn    set
[inline]
 

Definition at line 178 of file SymbolTable.h.

References NameList::add_name, NameList::data, NameList::set_data, SymbolTableElement::set_single_fctn, SymbolTableElement::single_fctn, and NameList::typecode.

Referenced by add_custom_singleword, and atomSelParser_init.

void SymbolTable::add_stringfctn const char *    visible,
SymbolTableElement::stringfctn_fctn    get
[inline]
 

Definition at line 190 of file SymbolTable.h.

References NameList::add_name, NameList::data, NameList::set_data, SymbolTableElement::stringfctn_fctn, and NameList::typecode.

Referenced by atomSelParser_init.

const char * SymbolTable::custom_singleword_name int   
 

Return name with given index, or NULL if not defined.

Definition at line 61 of file SymbolTable.C.

References NameList< char * >::name.

Referenced by make_tcl_atomsel, and py_allmacros.

int SymbolTable::find_attribute const char *    attrib [inline]
 

find keyword/function matching the name and return function index, or -1.

Definition at line 212 of file SymbolTable.h.

References NameList::typecode.

Referenced by add_custom_singleword, atomsel_get, atomsel_set, get_attribute_index, get_weights_from_attribute, remove_custom_singleword, split_tcl_atomsel_info, tcl_get_weights, vmd_measure_cluster, and vmd_measure_clustsize.

const char * SymbolTable::get_custom_singleword const char *    name
 

get the macro for the given singleword.

Definition at line 102 of file SymbolTable.C.

References NameList< char * >::data, NULL, and NameList< char * >::typecode.

Referenced by make_tcl_atomsel, py_getmacro, and SelectionBuilder::update_macrobrowser.

int SymbolTable::is_changeable int    fctnidx
 

returns '1' if the variable can be changed/ modified.

Definition at line 46 of file SymbolTable.C.

References NameList< SymbolTableElement * >::data, fctns, NameList< SymbolTableElement * >::num, and SymbolTableElement::set_fctn.

Referenced by atomsel_set, and py_list_attrs.

int SymbolTable::num_custom_singleword  
 

Query what custom singlewords have been defined. Note: these include those have been deleted, because the implementation of remove_custom only sets the string to "". Text API's will want to only return the strings that have nonzero length.

Definition at line 57 of file SymbolTable.C.

References NameList< char * >::num.

Referenced by make_tcl_atomsel, and py_allmacros.

ParseTree * SymbolTable::parse const char *    seltext
 

parse selection text, return a new ParseTree on success, NULL on error.

Definition at line 127 of file SymbolTable.C.

References app, atomparser_yystring, NULL, and yyparse.

Referenced by add_custom_singleword, AtomSel::change, MoleculeList::change_repsel, MoleculeList::set_default_selection, and MoleculeList::set_selection.

int SymbolTable::remove_custom_singleword const char *    name
 

delete the given singleword macro.

Definition at line 108 of file SymbolTable.C.

References fctns, find_attribute, NameList< SymbolTableElement * >::set_name, NameList< char * >::set_name, and NameList< char * >::typecode.

Referenced by make_tcl_atomsel, and py_delmacro.


Member Data Documentation

VMDApp* SymbolTable::app
 

Definition at line 130 of file SymbolTable.h.

Referenced by parse.

NameList<SymbolTableElement *> SymbolTable::fctns
 

Definition at line 131 of file SymbolTable.h.

Referenced by access_tcl_atomsel, atomsel_get, atomsel_set, get_weights_from_attribute, is_changeable, make_tcl_atomsel, py_list_attrs, remove_custom_singleword, SelectionBuilder::SelectionBuilder, split_tcl_atomsel_info, tcl_get_weights, SelectionBuilder::update_macrobrowser, vmd_measure_cluster, vmd_measure_clustsize, and ~SymbolTable.


The documentation for this class was generated from the following files:
Generated on Fri Dec 6 02:47:21 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002