jitcraft/CompileContext.h
changeset 25 23e8b3d8e4e6
child 59 b7d61ddb3c8d
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/jitcraft/CompileContext.h	Mon Jul 02 01:24:57 2012 -0700
     1.3 @@ -0,0 +1,47 @@
     1.4 +/*
     1.5 + * Copyright (C) 2012 David Anderson
     1.6 + *
     1.7 + * This file is part of JITCraft.
     1.8 + *
     1.9 + * JITCraft is free software: you can redistribute it and/or modify it under
    1.10 + * the terms of the GNU General Public License as published by the Free
    1.11 + * Software Foundation, either version 3 of the License, or (at your option)
    1.12 + * any later version.
    1.13 + * 
    1.14 + * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY
    1.15 + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    1.16 + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
    1.17 + *
    1.18 + * You should have received a copy of the GNU General Public License along with
    1.19 + * JITCraft. If not, see http://www.gnu.org/licenses/.
    1.20 + */
    1.21 +#ifndef _include_jitcraft_compile_context_h_
    1.22 +#define _include_jitcraft_compile_context_h_
    1.23 +
    1.24 +#include <stdarg.h>
    1.25 +#include "Messages.h"
    1.26 +
    1.27 +namespace jc {
    1.28 +
    1.29 +class Zone;
    1.30 +struct SourcePosition;
    1.31 +
    1.32 +class CompileContext
    1.33 +{
    1.34 +    Zone *zone_;
    1.35 +    unsigned failures_;
    1.36 +
    1.37 +  public:
    1.38 +    CompileContext(Zone *zone);
    1.39 +
    1.40 +    void reportErrorVa(const SourcePosition &pos, Message msg, va_list ap);
    1.41 +    void reportError(const SourcePosition &pos, Message msg, ...);
    1.42 +
    1.43 +    unsigned failures() const {
    1.44 +        return failures_;
    1.45 +    }
    1.46 +};
    1.47 +
    1.48 +}
    1.49 +
    1.50 +#endif // _include_jitcraft_compile_context_h_