1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
# Most of the interesting types of class declarations
---input---
class Foo;
endclass
class Bar;
endclass : Bar
class Fiz extends Buz;
endclass : Fiz
class Free #(parameter type T = byte) extends Beer #(T);
endclass : Free
---tokens---
'class' Keyword.Declaration
' ' Text.Whitespace
'Foo' Name.Class
';' Punctuation
'\n' Text.Whitespace
'endclass' Keyword.Declaration
'\n\n' Text.Whitespace
'class' Keyword.Declaration
' ' Text.Whitespace
'Bar' Name.Class
';' Punctuation
'\n' Text.Whitespace
'endclass' Keyword.Declaration
' ' Text.Whitespace
':' Punctuation
' ' Text.Whitespace
'Bar' Name.Class
'\n\n' Text.Whitespace
'class' Keyword.Declaration
' ' Text.Whitespace
'Fiz' Name.Class
' ' Text.Whitespace
'extends' Keyword.Declaration
' ' Text.Whitespace
'Buz' Name.Class
';' Punctuation
'\n' Text.Whitespace
'endclass' Keyword.Declaration
' ' Text.Whitespace
':' Punctuation
' ' Text.Whitespace
'Fiz' Name.Class
'\n\n' Text.Whitespace
'class' Keyword.Declaration
' ' Text.Whitespace
'Free' Name.Class
' ' Text.Whitespace
'#' Punctuation
'(' Punctuation
'parameter' Keyword
' ' Text.Whitespace
'type' Keyword.Type
' ' Text.Whitespace
'T' Name
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'byte' Keyword.Type
')' Punctuation
' ' Text.Whitespace
'extends' Keyword.Declaration
' ' Text.Whitespace
'Beer' Name.Class
' ' Text.Whitespace
'#' Punctuation
'(' Punctuation
'T' Name
')' Punctuation
';' Punctuation
'\n' Text.Whitespace
'endclass' Keyword.Declaration
' ' Text.Whitespace
':' Punctuation
' ' Text.Whitespace
'Free' Name.Class
'\n' Text.Whitespace
|