Česky
Kamil Dudka

Flex/Bison based compiler and interpreter written in C++ (using Boost)

File detail

Name:Downloadbuilder.h [Download]
Location: vyp08 > vyp08-1.0pre1 > src
Size:2.1 KB
Last modification:2009-07-04 19:51

Source code

/*
 * Copyright (C) 2008 Kamil Dudka <xdudka00@stud.fit.vutbr.cz>
 *
 * This file is part of vyp08 (compiler and interpreter of VYP08 language).
 *
 * vyp08 is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * vyp08 is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with vyp08.  If not, see <http://www.gnu.org/licenses/>.
 */
 
#ifndef BUILDER_H
#define BUILDER_H
 
#include "config.h"
 
#ifndef BUILDING_DOX
#   include <string>
#endif
 
class IBuilder;
class Vm;
 
/**
 * static-only factory for builder object
 */
class BuilderFactory {
    public:
        /**
         * Return on heap allocated builder object.
         * @param vm Already initialized virtual machine you are
         * going to build with the builder.
         */
        static IBuilder* createBuilder(Vm *vm);
    private:
        BuilderFactory();
};
 
class FncDeclaration;
class FncDefinition;
 
/**
 * Common usage functions factory
 */
class FncFactory {
    public:
        static bool initVm(Vm *);                       ///< initialize given vm
 
        FncFactory(Vm *vm);                             ///< @param vm Virtual machine to create factory for.
        virtual ~FncFactory();
 
        FncDeclaration* createMainDecl();               ///< create main() function @b declaration
        FncDefinition* createPrint();                   ///< create @b empty print() function
        FncDefinition* createInputString();             ///< create @b empty inputstring() function
        FncDefinition* createInputInt();                ///< create @b empty inputint() function
        FncDefinition* createInputDouble();             ///< create @b empty inputdouble() function
    private:
        struct Private;
        Private *d;
};
 
#endif /* BUILDER_H */