amath  1.8.5
Simple command line calculator
kword.h
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  * Generated with FlexCat. For more information, see:
26  * http://sourceforge.net/projects/flexcat/
27  *
28  * Project homepage:
29  * https://amath.innolan.net
30  *
31  */
32 
33 #ifndef AMATH_LOCALE_KEYWORD_H
34 #define AMATH_LOCALE_KEYWORD_H
35 
36 /**
37  * @file loc/kword.h
38  * @brief Keywords used by lexer
39  */
40 
41 #include "amath.h"
42 #include "amathc.h"
43 #include "main/symbol.h"
44 
45 /**
46  * @brief Character representation of keyword tied with its symbol
47  */
48 struct keyworddef
49 {
50  int id;
51  Symbol symbol;
52  const char* name;
53 };
54 
55 static const keyworddef keywords[] = {
56  { 0, symclear, "clear" },
57  { 1, symdef, "def" },
58  { 2, symdelete, "delete" },
59  { 3, syme, "e" },
60  { 4, symi, "i" },
61  { 5, sympi, "pi" },
62  { 6, symins, "ins" },
63  { 7, symeval, "eval" },
64  { 8, symdraw, "draw" },
65  { 9, symplot, "plot" },
66  { 10, symexecute, "execute" },
67  { 11, symexit, "exit" },
68  { 12, symexit, "quit" },
69  { 13, symstatement, "statements" },
70  { 14, symoperator, "operators" },
71  { 15, symcomplex, "complex" },
72  { 16, symfunction, "funcs" },
73  { 17, symfunction, "functions" },
74  { 18, symtrigon, "trigon" },
75  { 19, symtrigon, "trigonometric" },
76  { 20, symhyper, "hyper" },
77  { 21, symhyper, "hyperbolic" },
78  { 22, symearly, "early" },
79  { 23, symhelp, "help" },
80  { 24, symprompt, "prompt" },
81  { 25, symversion, "version" },
82  { 26, symmem, "mem" },
83  { 27, symmem, "memory" },
84  { 28, symprefs, "prefs" },
85  { 29, symprefs, "preferences" },
86  { 30, symlist, "list" },
87  { 31, symload, "load" },
88  { 32, symsave, "save" },
89  { 33, symshow, "show" },
90  { 34, symvariable, "vars" },
91  { 35, symvariable, "variables" },
92  { 36, symdigits, "digits" },
93  { 37, syminput, "input" },
94  { 38, symoutput, "output" },
95  { 39, symbin, "bin" },
96  { 40, symbin, "binary" },
97  { 41, symoct, "oct" },
98  { 42, symoct, "octal" },
99  { 43, symdec, "dec" },
100  { 44, symdec, "decimal" },
101  { 45, symhex, "hex" },
102  { 46, symhex, "hexadecimal" },
103  { 47, symabout, "about" },
104  { 48, symlicense, "license" },
105  { -1, Symbol(0), EMPTYSTRING }
106 };
107 
108 #endif
Definition: symbol.h:84
Definition: symbol.h:93
const char * name
Definition: kword.h:52
#define EMPTYSTRING
Definition: amath.h:213
Definition: symbol.h:90
Definition: symbol.h:76
Definition: symbol.h:82
Character representation of keyword tied with its symbol.
Definition: kword.h:48
Definition: symbol.h:92
static const keyworddef keywords[]
Definition: kword.h:55
Definition: symbol.h:79
Definition: symbol.h:83
Definition: symbol.h:91
Definition: symbol.h:98
Definition: symbol.h:85
Symbol symbol
Definition: kword.h:51
Definition: symbol.h:67
int id
Definition: kword.h:50
Definition: symbol.h:99
Definition: symbol.h:78
Definition: symbol.h:77
Definition: symbol.h:62
Definition: symbol.h:94
Definition: symbol.h:61
Definition: symbol.h:66