Annotation of parser3/src/types/pa_vvoid.h, revision 1.1
1.1 ! parser 1: /** @file
! 2: Parser: @b void parser class.
! 3:
! 4: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
! 5:
! 6: Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
! 7:
! 8: $Id: pa_vvoid.h,v 1.1 2001/05/21 17:11:57 parser Exp $
! 9: */
! 10:
! 11: #ifndef PA_VVOID_H
! 12: #define PA_VVOID_H
! 13:
! 14: #include "pa_vstateless_object.h"
! 15: #include "pa_globals.h"
! 16:
! 17: extern Methoded *void_class;
! 18:
! 19: /// value of type 'void'. ex: usually $sjfklsjfksjdfk has this type
! 20: class VVoid : public VStateless_object {
! 21: public: // Value
! 22:
! 23: const char *type() const { return "void"; }
! 24:
! 25: /// VVoid: ""
! 26: const String *get_string() { return empty_string; }
! 27: /// VVoid: false
! 28: bool is_defined() const { return false; }
! 29: /// VVoid: 0
! 30: double as_double() { return 0; }
! 31: /// VVoid: 0
! 32: int as_int() { return 0; }
! 33: /// VVoid: this
! 34: Value *as_expr_result(bool return_string_as_is=false) { return this; }
! 35:
! 36: /// VVoid: false
! 37: bool as_bool() { return false; }
! 38:
! 39: /// VVoid: methods
! 40: Value *get_element(const String& name) {
! 41: // methods
! 42: if(Value *result=VStateless_object::get_element(name))
! 43: return result;
! 44:
! 45: return NEW VVoid(pool());
! 46: }
! 47:
! 48: public: // usage
! 49:
! 50: VVoid(Pool& apool) : VStateless_object(apool, *void_class) {
! 51: }
! 52:
! 53: };
! 54:
! 55: #endif
E-mail: