src/codegens.h

Tue, 23 Aug 2016 16:34:02 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 23 Aug 2016 16:34:02 +0200
changeset 47
c39ecbbca7c0
parent 46
534a4ef4143d
child 48
b2724c711203
permissions
-rw-r--r--

words (token) are now stored as sstr_t

universe@21 1 /*
universe@21 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
universe@21 3 *
universe@35 4 * Copyright 2016 Mike Becker. All rights reserved.
universe@21 5 *
universe@21 6 * Redistribution and use in source and binary forms, with or without
universe@21 7 * modification, are permitted provided that the following conditions are met:
universe@21 8 *
universe@21 9 * 1. Redistributions of source code must retain the above copyright
universe@21 10 * notice, this list of conditions and the following disclaimer.
universe@21 11 *
universe@21 12 * 2. Redistributions in binary form must reproduce the above copyright
universe@21 13 * notice, this list of conditions and the following disclaimer in the
universe@21 14 * documentation and/or other materials provided with the distribution.
universe@21 15 *
universe@21 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
universe@21 17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
universe@21 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
universe@21 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
universe@21 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
universe@21 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
universe@21 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
universe@21 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
universe@21 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
universe@21 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
universe@21 26 * POSSIBILITY OF SUCH DAMAGE.
universe@21 27 *
universe@21 28 */
universe@21 29
universe@21 30 #ifndef CODEGENS_H
universe@21 31 #define CODEGENS_H
universe@21 32
universe@21 33 #include <stdio.h>
universe@47 34 #include "ucx/string.h"
universe@45 35 #include "ucx/buffer.h"
universe@21 36
universe@21 37 #ifdef __cplusplus
universe@21 38 extern "C" {
universe@21 39 #endif
universe@21 40
universe@47 41 #define WORDBUF_SIZE 256
universe@21 42
universe@47 43 typedef void(*highlighter_func)(char*,UcxBuffer*,int*);
universe@46 44
universe@46 45 #define iswordcharacter(c) (isalnum(c) || c=='_' || c=='#' || c=='@')
universe@21 46 size_t writeescapedchar(char *dest, size_t dp, char c);
universe@47 47 int check_keyword(sstr_t word, const char** keywords);
universe@47 48 int check_capsonly(sstr_t word);
universe@21 49
universe@21 50
universe@21 51 #ifdef __cplusplus
universe@21 52 }
universe@21 53 #endif
universe@21 54
universe@21 55 #endif /* CODEGENS_H */
universe@21 56

mercurial