OSDN Git Service

expression.c, stream.c, textfile.txt, token.cの追加
[gleam-language/alpha.git] / expression.c
1 #include "common.h"
2
3 /*
4 * expression.c  --manage expressions
5
6 * Copyright(C) 2013(Heisei 25) ttwilb All rights reserved.
7
8 * This source code is released on the BSD licensing.
9
10 */
11
12 #define EXPRESSION_BUF_MAX      100
13
14 struct Expression expression_buf[EXPRESSION_BUF_MAX];
15 int expression_buf_count = 0;
16
17 struct Expression* alloc_expression()
18 {
19         if(!expression_buf_count >= EXPRESSION_BUF_MAX)
20         {
21                 return &expression_buf[expression_buf_count++];
22         }else
23         {
24                 printf("----Fatal: expression allocation error");
25                 return (struct Expression *) 0;
26         }
27 }