Annotation of parser3/src/types/pa_vnothing.h, revision 1.1

1.1     ! parser      1: /** @file
        !             2:        Parser: @b nothing 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_vnothing.h,v 1.13 2001/05/11 17:45:10 parser Exp $
        !             9: */
        !            10: 
        !            11: #ifndef PA_VNOTHING_H
        !            12: #define PA_VNOTHING_H
        !            13: 
        !            14: #include "pa_vstateless_object.h"
        !            15: #include "pa_globals.h"
        !            16: 
        !            17: extern Methoded *nothing_class;
        !            18: 
        !            19: /// value of type 'nothing'. ex: usually $sjfklsjfksjdfk has this type
        !            20: class VNothing : public VStateless_object {
        !            21: public: // Value
        !            22: 
        !            23:        const char *type() const { return "nothing"; }
        !            24: 
        !            25:        /// VNothing: ""
        !            26:        const String *get_string() { return empty_string; }
        !            27:        /// VNothing: false
        !            28:        bool is_defined() const { return false; }
        !            29:        /// VNothing: 0
        !            30:        double as_double() { return 0; }
        !            31:        /// VNothing: 0
        !            32:        int as_int() { return 0; }
        !            33:        /// VNothing: this
        !            34:        Value *as_expr_result(bool return_string_as_is=false) { return this; }
        !            35: 
        !            36:        /// VNothing: false
        !            37:        bool as_bool() { return false; }
        !            38: 
        !            39:        /// VNothing: 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 VNothing(pool());
        !            46:        }
        !            47: 
        !            48: public: // usage
        !            49: 
        !            50:        VNothing(Pool& apool) : VStateless_object(apool, *nothing_class) {
        !            51:        }
        !            52: 
        !            53: };
        !            54: 
        !            55: #endif

E-mail: