jitcraft/CompileContext.h
author David Anderson <dvander@alliedmods.net>
Sun Jul 08 01:54:08 2012 -0700 (2012-07-08)
changeset 60 581a9c793062
parent 59 b7d61ddb3c8d
child 69 dfce0539a77d
permissions -rw-r--r--
Initial import of some kind of API.
dvander@25
     1
/*
dvander@25
     2
 * Copyright (C) 2012 David Anderson
dvander@25
     3
 *
dvander@25
     4
 * This file is part of JITCraft.
dvander@25
     5
 *
dvander@25
     6
 * JITCraft is free software: you can redistribute it and/or modify it under
dvander@25
     7
 * the terms of the GNU General Public License as published by the Free
dvander@25
     8
 * Software Foundation, either version 3 of the License, or (at your option)
dvander@25
     9
 * any later version.
dvander@25
    10
 * 
dvander@25
    11
 * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY
dvander@25
    12
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
dvander@25
    13
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
dvander@25
    14
 *
dvander@25
    15
 * You should have received a copy of the GNU General Public License along with
dvander@25
    16
 * JITCraft. If not, see http://www.gnu.org/licenses/.
dvander@25
    17
 */
dvander@25
    18
#ifndef _include_jitcraft_compile_context_h_
dvander@25
    19
#define _include_jitcraft_compile_context_h_
dvander@25
    20
dvander@25
    21
#include <stdarg.h>
dvander@25
    22
#include "Messages.h"
dvander@25
    23
dvander@59
    24
namespace ke {
dvander@25
    25
dvander@25
    26
class Zone;
dvander@25
    27
struct SourcePosition;
dvander@25
    28
dvander@25
    29
class CompileContext
dvander@25
    30
{
dvander@25
    31
    Zone *zone_;
dvander@25
    32
    unsigned failures_;
dvander@25
    33
dvander@25
    34
  public:
dvander@25
    35
    CompileContext(Zone *zone);
dvander@25
    36
dvander@25
    37
    void reportErrorVa(const SourcePosition &pos, Message msg, va_list ap);
dvander@25
    38
    void reportError(const SourcePosition &pos, Message msg, ...);
dvander@25
    39
dvander@25
    40
    unsigned failures() const {
dvander@25
    41
        return failures_;
dvander@25
    42
    }
dvander@25
    43
};
dvander@25
    44
dvander@25
    45
}
dvander@25
    46
dvander@25
    47
#endif // _include_jitcraft_compile_context_h_