Humboldt-Universität zu Berlin
ZE Rechenzentrum (CMS)
Abt. Systemsoftware und Kommunikation
Dr. rer. nat. Andreas Kunert
HU-CMS-Logo  HU-Berlin Logo

Lexik der Sprache C0

Schlüsselwörter

KW_BOOLEAN"bool"
KW_DO "do"
KW_ELSE "else"
KW_FLOAT "float"
KW_FOR "for"
KW_IF "if"
KW_INT "int"
KW_PRINTF "printf"
KW_RETURN "return"
KW_VOID "void"
KW_WHILE "while"

Operatoren

PLUS"+"
MINUS"-"
ASTERISK"*"
SLASH"/"
ASSIGN"="
EQ"=="
NEQ"!="
LSS"<"
GRT">"
LEQ"<="
GEQ">="
AND"&&"
OR "||"

Sonstige Token

COMMA","
SEMICOLON";"
LPAREN"("
RPAREN")"
LBRACE"{"
RBRACE"}"

Termvariablen

CONST_INT {INTEGER}
CONST_FLOAT{FLOAT} ( [eE] ([-+])? {INTEGER} )?
| {INTEGER} [eE] ([-+])? {INTEGER}
CONST_BOOLEAN"true" | "false"
ID ({LETTER})+ ({DIGIT} | {LETTER})*

"Pseudotoken" (nur zur Konstruktion anderer Token)

DIGIT [0-9]
INTEGER{DIGIT}+
FLOAT {INTEGER} "." {INTEGER} | "." {INTEGER}
LETTER [a-zA-Z]

Kommentare

C-Kommentare"/*" <comment> "*/"
C++-Kommentare"//" <comment> "\n"