Mercurial > octave
comparison src/symtab.cc @ 2086:bfb775fb6fe8
[project @ 1996-04-25 05:55:19 by jwe]
author | jwe |
---|---|
date | Thu, 25 Apr 1996 05:55:19 +0000 |
parents | 003570e69c7b |
children | bd389b53befa |
comparison
equal
deleted
inserted
replaced
2085:7603b37325db | 2086:bfb775fb6fe8 |
---|---|
47 symbol_def::symbol_def (void) | 47 symbol_def::symbol_def (void) |
48 { | 48 { |
49 init_state (); | 49 init_state (); |
50 } | 50 } |
51 | 51 |
52 symbol_def::symbol_def (tree_constant *t) | 52 symbol_def::symbol_def (octave_value *t) |
53 { | 53 { |
54 init_state (); | 54 init_state (); |
55 definition = t; | 55 definition = t; |
56 type = USER_VARIABLE; | 56 type = USER_VARIABLE; |
57 } | 57 } |
134 { | 134 { |
135 return (type & BUILTIN_FUNCTION); | 135 return (type & BUILTIN_FUNCTION); |
136 } | 136 } |
137 | 137 |
138 void | 138 void |
139 symbol_def::define (tree_constant *t) | 139 symbol_def::define (octave_value *t) |
140 { | 140 { |
141 definition = t; | 141 definition = t; |
142 if (! is_builtin_variable ()) | 142 if (! is_builtin_variable ()) |
143 type = USER_VARIABLE; | 143 type = USER_VARIABLE; |
144 } | 144 } |
368 { | 368 { |
369 sv_fcn = f; | 369 sv_fcn = f; |
370 } | 370 } |
371 | 371 |
372 int | 372 int |
373 symbol_record::define (tree_constant *t) | 373 symbol_record::define (octave_value *t) |
374 { | 374 { |
375 if (is_variable () && read_only_error ()) | 375 if (is_variable () && read_only_error ()) |
376 return 0; | 376 return 0; |
377 | 377 |
378 tree_fvc *saved_def = 0; | 378 tree_fvc *saved_def = 0; |
396 | 396 |
397 if (sv_fcn && sv_fcn () < 0) | 397 if (sv_fcn && sv_fcn () < 0) |
398 { | 398 { |
399 // Would be nice to be able to avoid this cast. XXX FIXME XXX | 399 // Would be nice to be able to avoid this cast. XXX FIXME XXX |
400 | 400 |
401 definition->define ((tree_constant *) saved_def); | 401 definition->define ((octave_value *) saved_def); |
402 return 0; | 402 return 0; |
403 } | 403 } |
404 | 404 |
405 delete saved_def; | 405 delete saved_def; |
406 | 406 |
463 | 463 |
464 return 1; | 464 return 1; |
465 } | 465 } |
466 | 466 |
467 int | 467 int |
468 symbol_record::define_as_fcn (tree_constant *t) | 468 symbol_record::define_as_fcn (octave_value *t) |
469 { | 469 { |
470 if (is_variable () && read_only_error ()) | 470 if (is_variable () && read_only_error ()) |
471 return 0; | 471 return 0; |
472 | 472 |
473 if (is_variable ()) | 473 if (is_variable ()) |
489 | 489 |
490 return 1; | 490 return 1; |
491 } | 491 } |
492 | 492 |
493 int | 493 int |
494 symbol_record::define_builtin_var (tree_constant *t) | 494 symbol_record::define_builtin_var (octave_value *t) |
495 { | 495 { |
496 define (t); | 496 define (t); |
497 if (is_variable ()) | 497 if (is_variable ()) |
498 definition->type = symbol_def::BUILTIN_VARIABLE; | 498 definition->type = symbol_def::BUILTIN_VARIABLE; |
499 return 1; | 499 return 1; |
688 | 688 |
689 if (sr.is_variable () && sr.is_defined ()) | 689 if (sr.is_variable () && sr.is_defined ()) |
690 { | 690 { |
691 // Would be nice to avoid this cast. XXX FIXME XXX | 691 // Would be nice to avoid this cast. XXX FIXME XXX |
692 | 692 |
693 tree_constant *tmp = (tree_constant *) sr.def (); | 693 octave_value *tmp = (octave_value *) sr.def (); |
694 if (tmp->is_real_scalar ()) | 694 if (tmp->is_real_scalar ()) |
695 const_type = SR_INFO_SCALAR; | 695 const_type = SR_INFO_SCALAR; |
696 else if (tmp->is_complex_scalar ()) | 696 else if (tmp->is_complex_scalar ()) |
697 const_type = SR_INFO_COMPLEX_SCALAR; | 697 const_type = SR_INFO_COMPLEX_SCALAR; |
698 else if (tmp->is_real_matrix ()) | 698 else if (tmp->is_real_matrix ()) |