aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-tokens.ads
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-01-09 08:38:26 +0100
committerTristan Gingold <tgingold@free.fr>2021-01-09 09:17:50 +0100
commitd2990978f76425b736e01c936e878048e4801f65 (patch)
tree7cfeab2180fd45b026e08e4fa896dbc0077cece9 /src/vhdl/vhdl-tokens.ads
parentadcfcc7f7703e9c26018f3fb7353a19797d263c8 (diff)
downloadghdl-d2990978f76425b736e01c936e878048e4801f65.tar.gz
ghdl-d2990978f76425b736e01c936e878048e4801f65.tar.bz2
ghdl-d2990978f76425b736e01c936e878048e4801f65.zip
vhdl: rework formatter engine, add 'ghdl fmt' command
Diffstat (limited to 'src/vhdl/vhdl-tokens.ads')
-rw-r--r--src/vhdl/vhdl-tokens.ads56
1 files changed, 37 insertions, 19 deletions
diff --git a/src/vhdl/vhdl-tokens.ads b/src/vhdl/vhdl-tokens.ads
index 6796b204a..00d22d1f9 100644
--- a/src/vhdl/vhdl-tokens.ads
+++ b/src/vhdl/vhdl-tokens.ads
@@ -23,27 +23,14 @@ package Vhdl.Tokens is
(
Tok_Invalid, -- current_token is not valid.
- Tok_Left_Paren, -- (
- Tok_Right_Paren, -- )
- Tok_Left_Bracket, -- [
- Tok_Right_Bracket, -- ]
- Tok_Colon, -- :
- Tok_Semi_Colon, -- ;
- Tok_Comma, -- ,
- Tok_Double_Arrow, -- =>
- Tok_Tick, -- '
- Tok_Double_Star, -- **
- Tok_Assign, -- :=
- Tok_Bar, -- |
- Tok_Box, -- <>
- Tok_Dot, -- .
-
- Tok_Equal_Equal, -- == (AMS Vhdl)
-
Tok_Eof, -- End of file.
Tok_Newline,
+
+ Tok_Block_Comment_Start, -- Start of a block comment (/*)
+ Tok_Block_Comment_End, -- End of a block comment (*/)
+
+ Tok_Block_Comment_Text, -- Text within a block comment (no newline)
Tok_Line_Comment, -- End of line comment (--)
- Tok_Block_Comment, -- Block comment (/* .. */)
Tok_Character,
Tok_Identifier,
Tok_Integer,
@@ -60,6 +47,24 @@ package Vhdl.Tokens is
-- scan vhdl 2008 (and later) bit string with a length.
Tok_Integer_Letter,
+ -- Delimiters
+ Tok_Left_Paren, -- (
+ Tok_Right_Paren, -- )
+ Tok_Left_Bracket, -- [
+ Tok_Right_Bracket, -- ]
+ Tok_Colon, -- :
+ Tok_Semi_Colon, -- ;
+ Tok_Comma, -- ,
+ Tok_Double_Arrow, -- =>
+ Tok_Tick, -- '
+ Tok_Double_Star, -- **
+ Tok_Assign, -- :=
+ Tok_Bar, -- |
+ Tok_Box, -- <>
+ Tok_Dot, -- .
+
+ Tok_Equal_Equal, -- == (AMS Vhdl)
+
-- relational_operator
Tok_Equal, -- =
Tok_Not_Equal, -- /=
@@ -323,7 +328,20 @@ package Vhdl.Tokens is
subtype Token_Multiplying_Operator_Type is Token_Type range
Tok_Star .. Tok_Rem;
- Tok_First_Keyword : constant Tokens.Token_Type := Tokens.Tok_Mod;
+ -- These tokens represent text in the source whose exact meaning needs
+ -- extra data (like the value of an integer, the exact identifier...).
+ subtype Token_Source_Type is Token_Type range
+ Tok_Line_Comment ..
+ --Tok_Character
+ --Tok_Identifier
+ --Tok_Integer
+ --Tok_Real
+ --Tok_String
+ --Tok_Bit_String
+ Tok_Integer_Letter;
+
+ Tok_First_Delimiter : constant Token_Type := Tok_Left_Paren;
+ Tok_First_Keyword : constant Token_Type := Tok_Mod;
-- Return the name of the token.
function Image (Token: Token_Type) return String;