File: tokens.cpp

package info (click to toggle)
sludge 2.2.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,852 kB
  • sloc: cpp: 32,432; sh: 1,237; makefile: 634; xml: 284
file content (16 lines) | stat: -rw-r--r-- 387 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <string.h>

#include "tokens.h"

const char * tokText[] = {"", "sub", "var", "objectType", "if", "!", "else", "return",
					"loop", "while", "for", "unfreezable", "debug", "flag","flags"};

tokenType getToken (char * inText) {
	int i;
	for (i = 1; i < numTokens; i ++) {
		if (strcmp (tokText[i], inText) == 0) return (tokenType) i;
	}
	return TOK_UNKNOWN;
}