Parser Class Reference

#include <parser.h>

+ Inheritance diagram for Parser:

Public Member Functions

ScripterExport Parser ()
 
ScripterExport Parser (CharStream *errout)
 
ScripterExport Parser (HashTable *scope)
 
ScripterExport Parser (CharStream *errout, HashTable *scope)
 
void init ()
 
ScripterExport Value * compile (CharStream *stream)
 
ScripterExport Value * compile_factor (CharStream *stream)
 
ScripterExport Value * compile_all (CharStream *stream)
 
void collect ()
 
void gc_trace ()
 
Value * single_expr (Value *stream)
 
Value * single_factor (Value *stream)
 
Value * compound_expr (Value *stream)
 
Value * compile_macro_script (Value *stream, MacroID id)
 
bool parse_rollout_for_edit (CharStream *source_stream, IVisualMSForm *form, Value *filename=NULL)
 
Value * compile_attributes (MSCustAttribDef *cad, CharStream *stream, Class_ID *attribID=NULL)
 
bool token_must_be (lex_token wanted_token)
 
bool next_token_must_be (lex_token wanted_token)
 
bool next_token_must_be_name (Value *wanted_name)
 
void back_track (void)
 
void back_track_factor (Value *fac)
 
bool white_space (MaxSDK::Util::Char &c)
 
void check_for_EOL (const MaxSDK::Util::Char &c)
 
void flush_EO_expr (void)
 
void reset ()
 
MaxSDK::Util::Char get_char ()
 
void unget_char (const MaxSDK::Util::Char &c)
 
void flush_to_eobuf ()
 
Value * get_string (const MaxSDK::Util::Char &delim)
 
Value * get_path_name ()
 
Value * get_name_thunk (Value *name, BOOL make_new)
 
Value * get_name_thunk (Value *name, BOOL make_new, BOOL forceGlobal)
 
lex_token get_punct (const MaxSDK::Util::Char &c)
 
lex_token get_token (void)
 
lex_token get_path_token (void)
 
int get_max_command (Value *&code)
 
Value * add_event_handler (HashTable *handlers, BOOL item_based=TRUE, IVisualMSForm *form=NULL)
 
Value * add_event_handler (HashTable *handlers, Value *owner, BOOL item_based=TRUE, IVisualMSForm *form=NULL)
 
void add_tool_local (const MCHAR *var, MouseTool *tool, int &local_count, ScopedValueTempArray &local_inits)
 
void add_plugin_local (const MCHAR *var, MSPluginClass *plugin, int &local_count, ScopedValueTempArray &local_inits, BOOL constant=FALSE)
 
void add_rollout_control (ScopedValueTempArray &controls, int control_index, Rollout *rollout, IVisualMSForm *form=NULL)
 
void add_rcmenu_item (ScopedValueTempArray &items, int &item_count, RCMenu *menu, BOOL subMenu=FALSE)
 
void open_include_file (const MaxSDK::Util::Char &c)
 
void check_for_const_lvalue (Value *&lval)
 
Value * optimize_return (Value *expr)
 
Value * source_position_wrap (Value *code)
 
Value * source_position_wrap (Value *code, unsigned int last_token_end, unsigned int last_token_end_line)
 
void insert_resource (Value *resourceID, CharStream *resourceSource)
 
Value * expr_seq (lex_token delimiter)
 
Value * vector_literal ()
 
Value * index_or_vector ()
 
Value * hash_literals ()
 
Value * array_literal ()
 
Value * bit_array_literal ()
 
Value * factor ()
 
Value * property_index_array ()
 
Value * coercion ()
 
Value * deref_expr ()
 
Value * function_call ()
 
Value * power_expr ()
 
Value * uminus_expr ()
 
Value * term ()
 
Value * plus_expr ()
 
Value * compare_expr ()
 
Value * not_expr ()
 
Value * and_expr ()
 
Value * simple_expr ()
 
Value * variable_declaration ()
 
Value * context_expr ()
 
Value * change_handler ()
 
Value * function (const MCHAR *name, short flags=0)
 
Value * function_def ()
 
Value * mapped_fn_def ()
 
Value * max_command ()
 
Value * handler_def ()
 
Value * struct_body (Value *name)
 
Value * struct_def ()
 
Value * try_catch ()
 
Value * tool_body (Value *name)
 
Value * tool_def ()
 
Value * rcmenu_body (Value *name)
 
Value * rcmenu_def ()
 
void plugin_paramblock (MSPluginClass *plugin, Array *pblock_defs, HashTable *handlers, int base_refno)
 
Value * plugin_def ()
 
Value * attributes_body (MSCustAttribDef *cad, Array *remap_param_names)
 
Value * attributes_def (MSCustAttribDef *cad=NULL, Class_ID *attribID=NULL)
 
Value * macro_script (MacroID mid=UNDEFINED_MACRO)
 
Value * rollout_body (Value *name, lex_token type=t_rollout, IVisualMSForm *form=NULL)
 
Value * utility_def ()
 
Value * rollout_def ()
 
Value * exit_expr ()
 
Value * continue_expr ()
 
Value * return_expr ()
 
Value * for_expr ()
 
Value * do_expr ()
 
Value * while_expr ()
 
Value * case_expr ()
 
Value * if_expr ()
 
Value * assign_expr ()
 
Value * expr ()
 
Value * top_level_expr ()
 
Value * function (const MCHAR *name, Value *owner, short flags=0)
 
- Public Member Functions inherited from Value
virtual ScripterExport BOOL is_kind_of (ValueMetaClass *c)
 
virtual ScripterExport ValueMetaClass * local_base_class ()
 
virtual Value * eval ()
 
virtual Value * eval_no_wrapper ()
 
virtual ScripterExport Value * apply (Value **arglist, int count, CallContext *cc=NULL)
 
virtual ScripterExport Value * apply_no_alloc_frame (Value **arglist, int count, CallContext *cc=NULL)
 
virtual void export_to_scripter ()
 
virtual Value * map (node_map &m)
 
virtual Value * map_path (PathName *path, node_map &m)
 
virtual Value * find_first (BOOL(*test_fn)(INode *node, int level, const void *arg), const void *test_arg)
 
virtual Value * get_path (PathName *path)
 
virtual ScripterExport void sprin1 (CharStream *stream)
 
virtual ScripterExport void sprint (CharStream *stream)
 
virtual void prin1 ()
 
virtual void print ()
 
virtual ScripterExport Class_ID get_max_class_id ()
 
virtual ScripterExport Value * delete_vf (Value **arglist, int arg_count)
 
virtual ScripterExport Value * clearSelection_vf (Value **arglist, int arg_count)
 
virtual float to_float ()
 
virtual double to_double ()
 
virtual const MCHAR * to_string ()
 
virtual MSTR to_mstr ()
 
virtual MSTR to_filename ()
 
virtual int to_int ()
 
virtual INT64 to_int64 ()
 
virtual INT_PTR to_intptr ()
 
virtual BOOL to_bool ()
 
virtual BitArray & to_bitarray ()
 
virtual Point4 to_point4 ()
 
virtual Point3 to_point3 ()
 
virtual Point2 to_point2 ()
 
virtual AColor to_acolor ()
 
virtual COLORREF to_colorref ()
 
virtual INode * to_node ()
 
virtual Ray to_ray ()
 
virtual Interval to_interval ()
 
virtual Quat to_quat ()
 
virtual AngAxis to_angaxis ()
 
virtual Matrix3 & to_matrix3 ()
 
virtual float * to_eulerangles ()
 
virtual Mtl * to_mtl ()
 
virtual Texmap * to_texmap ()
 
virtual MtlBase * to_mtlbase ()
 
virtual Modifier * to_modifier ()
 
virtual TimeValue to_timevalue ()
 
virtual Control * to_controller ()
 
virtual Atmospheric * to_atmospheric ()
 
virtual Effect * to_effect ()
 
virtual IMultiPassCameraEffect * to_mpassCamEffect ()
 
virtual ShadowType * to_shadowtype ()
 
virtual FilterKernel * to_filter ()
 
virtual INode * to_rootnode ()
 
virtual ITrackViewNode * to_trackviewnode ()
 
virtual NURBSIndependentPoint * to_nurbsindependentpoint ()
 
virtual NURBSPoint * to_nurbspoint ()
 
virtual NURBSObject * to_nurbsobject ()
 
virtual NURBSControlVertex * to_nurbscontrolvertex ()
 
virtual NURBSCurve * to_nurbscurve ()
 
virtual NURBSCVCurve * to_nurbscvcurve ()
 
virtual NURBSSurface * to_nurbssurface ()
 
virtual NURBSTexturePoint * to_nurbstexturepoint ()
 
virtual NURBSSet * to_nurbsset ()
 
virtual ReferenceTarget * to_reftarg ()
 
virtual Mesh * to_mesh ()
 
virtual BezierShape * to_beziershape ()
 
virtual Thunk * to_thunk ()
 
virtual void to_fpvalue (FPValue &v)
 
virtual Renderer * to_renderer ()
 
virtual Box2 & to_box2 ()
 
virtual NURBSTextureSurface * to_nurbstexturesurface ()
 
virtual NURBSDisplay * to_nurbsdisplay ()
 
virtual TessApprox * to_tessapprox ()
 
virtual Value * widen_to (Value *arg, Value **arg_list)
 
virtual BOOL comparable (Value *arg)
 
virtual BOOL is_const ()
 
virtual BOOL derives_from_MAXWrapper ()
 
virtual ScripterExport Value * get_property (Value **arg_list, int count)
 
virtual ScripterExport Value * set_property (Value **arg_list, int count)
 
ScripterExport Value * _get_property (Value *prop)
 
virtual ScripterExport Value * _set_property (Value *prop, Value *val)
 
virtual Value * get_container_property (Value *prop, Value *cur_prop)
 
virtual Value * set_container_property (Value *prop, Value *val, Value *cur_prop)
 
virtual BOOL _is_collection ()
 
virtual BOOL _is_charstream ()
 
virtual BOOL _is_rolloutcontrol ()
 
virtual BOOL _is_rolloutthunk ()
 
virtual BOOL _is_function ()
 
virtual BOOL _is_selection ()
 
virtual BOOL _is_thunk ()
 
virtual BOOL _is_indirect_thunk ()
 
virtual SelectionIterator * selection_iterator ()
 
virtual ScripterExport IOResult Save (ISave *isave)
 
virtual void drop_MAX_refs ()
 
virtual BaseInterface * GetInterface (Interface_ID id)
 
ScripterExport Value * make_heap_permanent ()
 
ScripterExport Value * make_heap_static ()
 
ScripterExport Value * get_heap_ptr ()
 
ScripterExport Value * get_stack_heap_ptr ()
 
ScripterExport Value * migrate_to_heap ()
 
ScripterExport Value * get_live_ptr ()
 
- Public Member Functions inherited from Collectable
ScripterExport Collectable ()
 
virtual ScripterExport ~Collectable ()
 
ScripterExport void * operator new (size_t sz, char flag)
 
ScripterExport void * operator new (size_t sz)
 
ScripterExport void operator delete (void *val)
 
ScripterExport void operator delete (void *val, char flag)
 
ScripterExport void make_collectable ()
 
void make_permanent ()
 
void make_static ()
 
int is_marked ()
 
int is_not_marked ()
 
int is_garbage ()
 
int is_permanent ()
 
void mark_in_use ()
 
void unmark_in_use ()
 
int has_heap_copy ()
 
int is_in_heap ()
 
int is_on_stack ()
 

Static Public Member Functions

static void setup ()
 
static bool should_source_position_wrap (Value *code)
 
- Static Public Member Functions inherited from Collectable
static ScripterExport void for_all_values (void(*map_fn)(Value *val), ValueMapper *mapper=NULL, ValueMetaClass *c=NULL)
 
static void mark ()
 
static void sweep ()
 
static void setup (size_t)
 
static ScripterExport void gc ()
 
static void coalesce_free_list ()
 
static void close_down ()
 
static void drop_maxwrapper_refs ()
 
static ScripterExport void push_alloc_stack_frame ()
 
static ScripterExport void pop_alloc_stack_frame ()
 
static ScripterExport ULONGLONG get_num_values_created ()
 
static ScripterExport bool validate_value_linkages ()
 

Public Attributes

CharStream * source
 
lex_token token
 
Value * token_value
 
bool at_EOL
 
bool back_tracked
 
bool EOL_at_back_track
 
bool quoted_level_name
 
bool spaced
 
bool space_before
 
bool space_after
 
bool throws_ok
 
bool in_macroscript
 
bool no_free_refs
 
bool no_stack_refs
 
bool dotted_names_ok
 
bool ignore_string_escapes
 
bool mzp_names
 
bool in_attributes_def
 
HashTable * current_scope
 
int parm_count
 
int keyparm_count
 
int local_count
 
int frame_index
 
int frame_level
 
int expr_level
 
CharStream * stdout_stream
 
Value * lookahead_factor
 
MCHAR line_buf [256]
 
MCHAR * line_buf_p
 
CharStream * source_capture
 
int ungetch_count
 
Tab< CharStream * > src_stack
 
Tab< CharStream * > src_capture_stack
 
MaxSDK::Array< ParserSourceData > src_parser_data_stack
 
Tab< int > src_stack_encryption_keys
 
int tok_start
 
int last_tok_end
 
int tok_start_line
 
int last_tok_end_line
 
int prev_last_tok_end
 
int prev_last_tok_end_line
 
int next_last_tok_end
 
int next_last_tok_end_line
 
CodeBlock * code_block
 
int code_block_level
 
int current_y
 
int bottom_y
 
int group_num
 
int eol_whitespace_start
 
int eol_whitespace_end
 
- Public Attributes inherited from Value
ValueMetaClass * tag
 
- Public Attributes inherited from Collectable
Collectable * next
 
Collectable * prev
 
byte flags
 
byte flags2
 
short flags3
 

Static Public Attributes

static Tab< rollout_control > rollout_controls
 
static MCHAR * token_names []
 
- Static Public Attributes inherited from Collectable
static CRITICAL_SECTION heap_update
 
static Collectable * collectable_list
 
static Collectable * permanent_list
 
static free_mem * free_list [GC_NUM_SUBLISTS]
 
static size_t heap_allocated
 
static size_t heap_size
 
static ScripterExport collectable_state state
 
static ScripterExport bool fullCollectNextHoldFlush
 
static bool gc_light
 
static bool in_gc
 
static HANDLE hGCCompletedEvent
 

Protected Member Functions

const MaxSDK::Util::Char & AppendCharToLineBuf (const MaxSDK::Util::Char &c)
 

Constructor & Destructor Documentation

ScripterExport Parser ( CharStream *  errout,
HashTable *  scope 
)

Member Function Documentation

void init ( )
ScripterExport Value* compile ( CharStream *  stream)
ScripterExport Value* compile_factor ( CharStream *  stream)
ScripterExport Value* compile_all ( CharStream *  stream)
static void setup ( )
static
void collect ( )
virtual

Implements Collectable.

void gc_trace ( )
virtual

Reimplemented from Collectable.

Value* single_expr ( Value *  stream)
Value* single_factor ( Value *  stream)
Value* compound_expr ( Value *  stream)
Value* compile_macro_script ( Value *  stream,
MacroID  id 
)
bool parse_rollout_for_edit ( CharStream *  source_stream,
IVisualMSForm *  form,
Value *  filename = NULL 
)
Value* compile_attributes ( MSCustAttribDef *  cad,
CharStream *  stream,
Class_ID *  attribID = NULL 
)
bool token_must_be ( lex_token  wanted_token)
bool next_token_must_be ( lex_token  wanted_token)
bool next_token_must_be_name ( Value *  wanted_name)
void back_track ( void  )
void back_track_factor ( Value *  fac)
bool white_space ( MaxSDK::Util::Char &  c)
void check_for_EOL ( const MaxSDK::Util::Char &  c)
void flush_EO_expr ( void  )
void reset ( )
MaxSDK::Util::Char get_char ( )
void unget_char ( const MaxSDK::Util::Char &  c)
void flush_to_eobuf ( )
Value* get_string ( const MaxSDK::Util::Char &  delim)
Value* get_path_name ( )
Value* get_name_thunk ( Value *  name,
BOOL  make_new 
)
Value* get_name_thunk ( Value *  name,
BOOL  make_new,
BOOL  forceGlobal 
)
lex_token get_punct ( const MaxSDK::Util::Char &  c)
lex_token get_token ( void  )
lex_token get_path_token ( void  )
int get_max_command ( Value *&  code)
Value* add_event_handler ( HashTable *  handlers,
BOOL  item_based = TRUE,
IVisualMSForm *  form = NULL 
)
Value* add_event_handler ( HashTable *  handlers,
Value *  owner,
BOOL  item_based = TRUE,
IVisualMSForm *  form = NULL 
)
void add_tool_local ( const MCHAR *  var,
MouseTool *  tool,
int &  local_count,
ScopedValueTempArray &  local_inits 
)
void add_plugin_local ( const MCHAR *  var,
MSPluginClass *  plugin,
int &  local_count,
ScopedValueTempArray &  local_inits,
BOOL  constant = FALSE 
)
void add_rollout_control ( ScopedValueTempArray &  controls,
int  control_index,
Rollout *  rollout,
IVisualMSForm *  form = NULL 
)
void add_rcmenu_item ( ScopedValueTempArray &  items,
int &  item_count,
RCMenu *  menu,
BOOL  subMenu = FALSE 
)
void open_include_file ( const MaxSDK::Util::Char &  c)
void check_for_const_lvalue ( Value *&  lval)
Value* optimize_return ( Value *  expr)
static bool should_source_position_wrap ( Value *  code)
static
Value* source_position_wrap ( Value *  code)
Value* source_position_wrap ( Value *  code,
unsigned int  last_token_end,
unsigned int  last_token_end_line 
)
void insert_resource ( Value *  resourceID,
CharStream *  resourceSource 
)
Value* expr_seq ( lex_token  delimiter)
Value* vector_literal ( )
Value* index_or_vector ( )
Value* hash_literals ( )
Value* array_literal ( )
Value* bit_array_literal ( )
Value* factor ( )
Value* property_index_array ( )
Value* coercion ( )
Value* deref_expr ( )
Value* function_call ( )
Value* power_expr ( )
Value* uminus_expr ( )
Value* term ( )
Value* plus_expr ( )
Value* compare_expr ( )
Value* not_expr ( )
Value* and_expr ( )
Value* simple_expr ( )
Value* variable_declaration ( )
Value* context_expr ( )
Value* change_handler ( )
Value* function ( const MCHAR *  name,
short  flags = 0 
)
Value* function_def ( )
Value* mapped_fn_def ( )
Value* max_command ( )
Value* handler_def ( )
Value* struct_body ( Value *  name)
Value* struct_def ( )
Value* try_catch ( )
Value* tool_body ( Value *  name)
Value* tool_def ( )
Value* rcmenu_body ( Value *  name)
Value* rcmenu_def ( )
void plugin_paramblock ( MSPluginClass *  plugin,
Array *  pblock_defs,
HashTable *  handlers,
int  base_refno 
)
Value* plugin_def ( )
Value* attributes_body ( MSCustAttribDef *  cad,
Array *  remap_param_names 
)
Value* attributes_def ( MSCustAttribDef *  cad = NULL,
Class_ID *  attribID = NULL 
)
Value* macro_script ( MacroID  mid = UNDEFINED_MACRO)
Value* rollout_body ( Value *  name,
lex_token  type = t_rollout,
IVisualMSForm *  form = NULL 
)
Value* utility_def ( )
Value* rollout_def ( )
Value* exit_expr ( )
Value* continue_expr ( )
Value* return_expr ( )
Value* for_expr ( )
Value* do_expr ( )
Value* while_expr ( )
Value* case_expr ( )
Value* if_expr ( )
Value* assign_expr ( )
Value* expr ( )
Value* top_level_expr ( )
Value* function ( const MCHAR *  name,
Value *  owner,
short  flags = 0 
)
const MaxSDK::Util::Char& AppendCharToLineBuf ( const MaxSDK::Util::Char &  c)
protected

Member Data Documentation

Tab<rollout_control> rollout_controls
static
MCHAR* token_names[]
static
CharStream* source
lex_token token
Value* token_value
bool at_EOL
bool back_tracked
bool EOL_at_back_track
bool quoted_level_name
bool spaced
bool space_before
bool space_after
bool throws_ok
bool in_macroscript
bool no_free_refs
bool no_stack_refs
bool dotted_names_ok
bool ignore_string_escapes
bool mzp_names
bool in_attributes_def
HashTable* current_scope
int parm_count
int keyparm_count
int local_count
int frame_index
int frame_level
int expr_level
CharStream* stdout_stream
Value* lookahead_factor
MCHAR line_buf[256]
MCHAR* line_buf_p
CharStream* source_capture
int ungetch_count
Tab<CharStream*> src_stack
Tab<CharStream*> src_capture_stack
MaxSDK::Array<ParserSourceData> src_parser_data_stack
Tab<int> src_stack_encryption_keys
int tok_start
int last_tok_end
int tok_start_line
int last_tok_end_line
int prev_last_tok_end
int prev_last_tok_end_line
int next_last_tok_end
int next_last_tok_end_line
CodeBlock* code_block
int code_block_level
int current_y
int bottom_y
int group_num
int eol_whitespace_start
int eol_whitespace_end