aboutsummaryrefslogtreecommitdiff
path: root/KicadNetLexer.g4
diff options
context:
space:
mode:
Diffstat (limited to 'KicadNetLexer.g4')
-rw-r--r--KicadNetLexer.g436
1 files changed, 36 insertions, 0 deletions
diff --git a/KicadNetLexer.g4 b/KicadNetLexer.g4
new file mode 100644
index 0000000..55bda85
--- /dev/null
+++ b/KicadNetLexer.g4
@@ -0,0 +1,36 @@
+lexer grammar KicadNetLexer;
+
+LPAREN: '(';
+RPAREN: ')';
+
+QUOTE: '"';
+
+CODE: 'code';
+COMP: 'comp';
+FIELD: 'field';
+NAME: 'name';
+NET: 'net';
+NODE: 'node';
+NUM: 'num';
+PIN: 'pin';
+REF: 'ref';
+TYPE: 'type';
+VALUE: 'value';
+
+
+//STRING: '"' (~[\\"] | '\\' [\\"])* '"';
+STRING: '"' ~["]* '"';
+
+INTEGER: [0-9]+;
+
+ID
+ : [/+~\_\-\.\*/a-zA-Z0-9]+
+ ;
+
+BlockComment
+ : '/*' .*? '*/' -> skip
+ ;
+
+WS
+ : [ \t\r\n]+ -> skip
+ ;