src/javacodegen.c

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

21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 /*
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3 *
35
abaf2489c549 adjusted copyright info
Mike Becker <universe@uap-core.de>
parents: 32
diff changeset
4 * Copyright 2016 Mike Becker. All rights reserved.
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 *
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 *
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11 *
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15 *
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
27 *
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
28 */
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
29
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
30 #include "javacodegen.h"
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
31 #include <string.h>
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
32 #include <ctype.h>
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
33
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
34 const char* jkeywords[] = {
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
35 "abstract", "continue", "for", "new", "switch", "assert", "default", "goto",
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
36 "package", "synchronized", "boolean", "do", "if", "private", "this",
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
37 "break", "double", "implements", "protected", "throw", "byte", "else",
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
38 "import", "public", "throws", "case", "enum", "instanceof", "return",
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
39 "transient", "catch", "extends", "int", "short", "try", "char", "final",
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
40 "interface", "static", "void", "class", "finally", "long", "strictfp",
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
41 "volatile", "const", "float", "native", "super", "while", NULL
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
42 };
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
43
29
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
44 #define memcpy_const(darr,doff,str) memcpy(&(darr[doff]), str, sizeof(str)-1); \
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
45 dp += sizeof(str)-1
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
46
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
47 void jparseline(char *src, UcxBuffer *destbuf, int *multiline_comment) {
45
1f3835182aeb changes signature of parser functions to use a UcxBuffer - the functions itself don't use the API yet
Mike Becker <universe@uap-core.de>
parents: 39
diff changeset
48 /* TODO: workaround for using old code with UcxBuffer */
1f3835182aeb changes signature of parser functions to use a UcxBuffer - the functions itself don't use the API yet
Mike Becker <universe@uap-core.de>
parents: 39
diff changeset
49 char *dest = destbuf->space + destbuf->pos;
1f3835182aeb changes signature of parser functions to use a UcxBuffer - the functions itself don't use the API yet
Mike Becker <universe@uap-core.de>
parents: 39
diff changeset
50
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
51 /* TODO: try to replace this buffer */
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
52 char wordbuf[WORDBUF_SIZE];
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
53 sstr_t word;
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
54 word.ptr = wordbuf; word.length = 0;
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
55
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
56 size_t sp = (size_t)-1, dp = 0;
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
57 int isstring = 0, iscomment = 0, isimport = 0;
28
1be8ea902ef4 fixed string highlighting when different quote symbol is in string
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
58 char quote = '\0';
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
59 int isescaping = 0;
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
60
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
61 if (*multiline_comment) {
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
62 iscomment = 1;
29
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
63 memcpy_const(dest, dp, "<span class=\"c2html-comment\">");
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
64 }
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
65
39
ac35daceb24c adds UCX + changes how the input file is read (uses an consecutive memory area now)
Mike Becker <universe@uap-core.de>
parents: 36
diff changeset
66 char c;
ac35daceb24c adds UCX + changes how the input file is read (uses an consecutive memory area now)
Mike Becker <universe@uap-core.de>
parents: 36
diff changeset
67 do {
ac35daceb24c adds UCX + changes how the input file is read (uses an consecutive memory area now)
Mike Becker <universe@uap-core.de>
parents: 36
diff changeset
68 c = src[++sp];
ac35daceb24c adds UCX + changes how the input file is read (uses an consecutive memory area now)
Mike Becker <universe@uap-core.de>
parents: 36
diff changeset
69 if (!c) break;
ac35daceb24c adds UCX + changes how the input file is read (uses an consecutive memory area now)
Mike Becker <universe@uap-core.de>
parents: 36
diff changeset
70
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
71 /* comments */
26
05c3c6842aef fixed wrong comment formatting in strings
Mike Becker <universe@uap-core.de>
parents: 24
diff changeset
72 if (!isstring && c == '/') {
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
73 if (*multiline_comment && sp > 0 && src[sp-1] == '*') {
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
74 iscomment = 0;
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
75 *multiline_comment = 0;
29
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
76 memcpy_const(dest, dp, "/</span>");
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
77 continue;
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
78 } else if (!iscomment && (src[sp+1] == '/' || src[sp+1] == '*')) {
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
79 iscomment = 1;
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
80 *multiline_comment = (src[sp+1] == '*');
29
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
81 memcpy_const(dest, dp, "<span class=\"c2html-comment\">");
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
82 }
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
83 }
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
84
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
85 if (iscomment) {
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
86 if (c == '\n') {
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
87 memcpy(&(dest[dp]), "</span>", 7);
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
88 dp += 7;
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
89 }
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
90 dp = writeescapedchar(dest, dp, c);
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
91 } else if (isimport) {
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
92 /* TODO: local imports */
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
93 } else {
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
94 /* strings */
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
95 if (!isescaping && (c == '\'' || c == '\"')) {
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
96 if (isstring) {
29
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
97 dp = writeescapedchar(dest, dp, c);
28
1be8ea902ef4 fixed string highlighting when different quote symbol is in string
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
98 if (c == quote) {
1be8ea902ef4 fixed string highlighting when different quote symbol is in string
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
99 isstring = 0;
29
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
100 memcpy_const(dest, dp, "</span>");
28
1be8ea902ef4 fixed string highlighting when different quote symbol is in string
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
101 } else {
1be8ea902ef4 fixed string highlighting when different quote symbol is in string
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
102 dp = writeescapedchar(dest, dp, c);
1be8ea902ef4 fixed string highlighting when different quote symbol is in string
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
103 }
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
104 } else {
28
1be8ea902ef4 fixed string highlighting when different quote symbol is in string
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
105 isstring = 1;
1be8ea902ef4 fixed string highlighting when different quote symbol is in string
Mike Becker <universe@uap-core.de>
parents: 26
diff changeset
106 quote = c;
29
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
107 memcpy_const(dest, dp,
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
108 "<span class=\"c2html-string\">");
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
109 dp = writeescapedchar(dest, dp, c);
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
110 }
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
111 } else {
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
112 if (isstring) {
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
113 dp = writeescapedchar(dest, dp, c);
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
114 } else if (!iswordcharacter(c)) {
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
115 if (word.length > 0 && word.length < WORDBUF_SIZE) {
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
116 int closespan = 1;
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
117 if (check_keyword(word, jkeywords)) {
29
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
118 memcpy_const(dest, dp,
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
119 "<span class=\"c2html-keyword\">");
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
120 } else if (isupper(word.ptr[0])) {
29
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
121 memcpy_const(dest, dp,
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
122 "<span class=\"c2html-type\">");
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
123 } else if (word.ptr[0] == '@') {
29
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
124 memcpy_const(dest, dp,
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
125 "<span class=\"c2html-directive\">");
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
126 } else if (check_capsonly(word)) {
29
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
127 memcpy_const(dest, dp,
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
128 "<span class=\"c2html-macroconst\">");
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
129 } else {
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
130 closespan = 0;
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
131 }
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
132 for (int i = 0 ; i < word.length ; i++) {
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
133 dp = writeescapedchar(dest, dp, word.ptr[i]);
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
134 }
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
135 if (closespan) {
29
ec6e97454e64 introduced macro for constant string memcpy + fixed string highlight fix
Mike Becker <universe@uap-core.de>
parents: 28
diff changeset
136 memcpy_const(dest, dp, "</span>");
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
137 }
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
138 }
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
139 word.length = 0;
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
140 dp = writeescapedchar(dest, dp, c);
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
141 } else {
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
142 /* read word */
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
143 if (word.length < WORDBUF_SIZE) {
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
144 word.ptr[word.length++] = c;
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
145 } else if (word.length == WORDBUF_SIZE) {
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
146 for (int i = 0 ; i < WORDBUF_SIZE ; i++) {
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
147 dp = writeescapedchar(dest, dp, word.ptr[i]);
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
148 }
47
c39ecbbca7c0 words (token) are now stored as sstr_t
Mike Becker <universe@uap-core.de>
parents: 46
diff changeset
149 word.length++;
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
150 dp = writeescapedchar(dest, dp, c);
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
151 } else {
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
152 dp = writeescapedchar(dest, dp, c);
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
153 }
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
154 }
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
155 }
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
156
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
157 isescaping = !isescaping & (c == '\\');
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
158 }
39
ac35daceb24c adds UCX + changes how the input file is read (uses an consecutive memory area now)
Mike Becker <universe@uap-core.de>
parents: 36
diff changeset
159 } while (c != '\n');
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
160 dest[dp] = 0;
45
1f3835182aeb changes signature of parser functions to use a UcxBuffer - the functions itself don't use the API yet
Mike Becker <universe@uap-core.de>
parents: 39
diff changeset
161
1f3835182aeb changes signature of parser functions to use a UcxBuffer - the functions itself don't use the API yet
Mike Becker <universe@uap-core.de>
parents: 39
diff changeset
162 /* TODO: workaround */
1f3835182aeb changes signature of parser functions to use a UcxBuffer - the functions itself don't use the API yet
Mike Becker <universe@uap-core.de>
parents: 39
diff changeset
163 destbuf->pos += dp;
1f3835182aeb changes signature of parser functions to use a UcxBuffer - the functions itself don't use the API yet
Mike Becker <universe@uap-core.de>
parents: 39
diff changeset
164 destbuf->size += dp;
21
537aec525835 structured source code
Mike Becker <universe@uap-core.de>
parents:
diff changeset
165 }

mercurial