[11 - Antlr Parser] Remove "out/" folder - add in .gitignore
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,5 +1,9 @@
|
|||||||
# IntelliJ folders
|
# IntelliJ folders
|
||||||
**/.idea/
|
**/.idea/
|
||||||
|
**/.out/
|
||||||
|
/.out/
|
||||||
|
# Exclude run configuration
|
||||||
|
!/.idea/runConfiguration
|
||||||
|
|
||||||
# IntelliJ files
|
# IntelliJ files
|
||||||
**/*.iml
|
**/*.iml
|
||||||
@@ -17,3 +21,4 @@
|
|||||||
|
|
||||||
# macOS files
|
# macOS files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ tokens {
|
|||||||
// Lexer stuff
|
// Lexer stuff
|
||||||
ID: ('a'..'z' | 'A'..'Z')
|
ID: ('a'..'z' | 'A'..'Z')
|
||||||
(options {
|
(options {
|
||||||
greedy = true;
|
greedy = true; // Lese alle möglichen Zeichen ein -> Zahlen in ID -> bleibt weiterhin ID
|
||||||
}: 'a'..'z' | 'A'..'Z' | '0'..'9')*;
|
}: 'a'..'z' | 'A'..'Z' | '0'..'9')*;
|
||||||
INTCONST: ('0'..'9')+;
|
INTCONST: ('0'..'9')+;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// $ANTLR 3.5.2 /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr Parser fuer X-Leer/src/de/dhbw/compiler/antlrxparser/X.g 2020-05-27 12:40:05
|
// $ANTLR 3.5.2 /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr Parser fuer X-Leer/src/de/dhbw/compiler/antlrxparser/X.g 2020-05-27 16:02:18
|
||||||
package de.dhbw.compiler.antlrxparser;
|
package de.dhbw.compiler.antlrxparser;
|
||||||
|
|
||||||
import org.antlr.runtime.*;
|
import org.antlr.runtime.*;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// $ANTLR 3.5.2 /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr Parser fuer X-Leer/src/de/dhbw/compiler/antlrxparser/X.g 2020-05-27 12:40:05
|
// $ANTLR 3.5.2 /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr Parser fuer X-Leer/src/de/dhbw/compiler/antlrxparser/X.g 2020-05-27 16:02:17
|
||||||
package de.dhbw.compiler.antlrxparser;
|
package de.dhbw.compiler.antlrxparser;
|
||||||
|
|
||||||
import org.antlr.runtime.*;
|
import org.antlr.runtime.*;
|
||||||
|
|||||||
7
X.tokens
7
X.tokens
@@ -1,7 +0,0 @@
|
|||||||
T__9=9
|
|
||||||
DECL=4
|
|
||||||
DECLLIST=5
|
|
||||||
INVALID=6
|
|
||||||
STATLIST=7
|
|
||||||
UMINUS=8
|
|
||||||
'TODO'=9
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
T__20=20
|
|
||||||
T__21=21
|
|
||||||
T__22=22
|
|
||||||
T__23=23
|
|
||||||
T__24=24
|
|
||||||
T__25=25
|
|
||||||
T__26=26
|
|
||||||
T__27=27
|
|
||||||
T__28=28
|
|
||||||
T__29=29
|
|
||||||
T__30=30
|
|
||||||
T__31=31
|
|
||||||
T__32=32
|
|
||||||
T__33=33
|
|
||||||
T__34=34
|
|
||||||
T__35=35
|
|
||||||
T__36=36
|
|
||||||
T__37=37
|
|
||||||
T__38=38
|
|
||||||
T__39=39
|
|
||||||
T__40=40
|
|
||||||
T__41=41
|
|
||||||
T__42=42
|
|
||||||
T__43=43
|
|
||||||
T__44=44
|
|
||||||
T__45=45
|
|
||||||
COMMENT=4
|
|
||||||
DECL=5
|
|
||||||
DECLLIST=6
|
|
||||||
DIGIT=7
|
|
||||||
FLOATCONST=8
|
|
||||||
ID=9
|
|
||||||
INTCONST=10
|
|
||||||
INVALID=11
|
|
||||||
LETTER=12
|
|
||||||
OTHER=13
|
|
||||||
POSDIGIT=14
|
|
||||||
STATLIST=15
|
|
||||||
STRINGCONST=16
|
|
||||||
UMINUS=17
|
|
||||||
WS=18
|
|
||||||
ZERO=19
|
|
||||||
'('=20
|
|
||||||
')'=21
|
|
||||||
'*'=22
|
|
||||||
'+'=23
|
|
||||||
'-'=24
|
|
||||||
'.'=25
|
|
||||||
'/'=26
|
|
||||||
':'=27
|
|
||||||
':='=28
|
|
||||||
';'=29
|
|
||||||
'<'=30
|
|
||||||
'='=31
|
|
||||||
'>'=32
|
|
||||||
'begin'=33
|
|
||||||
'else'=34
|
|
||||||
'end'=35
|
|
||||||
'float'=36
|
|
||||||
'for'=37
|
|
||||||
'if'=38
|
|
||||||
'int'=39
|
|
||||||
'print'=40
|
|
||||||
'program'=41
|
|
||||||
'read'=42
|
|
||||||
'string'=43
|
|
||||||
'then'=44
|
|
||||||
'while'=45
|
|
||||||
Binary file not shown.
@@ -1,42 +0,0 @@
|
|||||||
/* **********************************************
|
|
||||||
* Duale Hochschule Baden-Württemberg Karlsruhe
|
|
||||||
* Prof. Dr. Jörn Eisenbiegler
|
|
||||||
*
|
|
||||||
* Vorlesung Übersetzerbau
|
|
||||||
* Praxis ANTLR-Parser für X
|
|
||||||
* - Grammatik für Scanner und Parser
|
|
||||||
*
|
|
||||||
* **********************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
grammar X;
|
|
||||||
|
|
||||||
options {
|
|
||||||
language = Java;
|
|
||||||
output = AST;
|
|
||||||
ASTLabelType = CommonTree;
|
|
||||||
backtrack = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// AST-Tokens
|
|
||||||
tokens {
|
|
||||||
ID;
|
|
||||||
INTCONST;
|
|
||||||
WS;
|
|
||||||
}
|
|
||||||
|
|
||||||
@parser::header {package de.dhbw.compiler.antlrxparser;}
|
|
||||||
@lexer::header {package de.dhbw.compiler.antlrxparser;}
|
|
||||||
|
|
||||||
// Anmerkung: Es müssen Lexer- UND Parser-Regeln stehen, da sonst das Generieren nicht funktionieren
|
|
||||||
// Lexer stuff
|
|
||||||
ID: ('a'..'z' | 'A'..'Z')
|
|
||||||
(options {
|
|
||||||
greedy = true;
|
|
||||||
}: 'a'..'z' | 'A'..'Z' | '0'..'9')*;
|
|
||||||
INTCONST: ('0'..'9')+;
|
|
||||||
|
|
||||||
WS: ('\t' | ' ' | '\r' | '\n' | '\f')+ { skip(); };
|
|
||||||
|
|
||||||
// Parser stuff
|
|
||||||
program: 'TODO';
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user