Skip to content

Commit

Permalink
vhdlpp: Handle true/false values.
Browse files Browse the repository at this point in the history
  • Loading branch information
orsonmmz committed Apr 23, 2015
1 parent cfa43c7 commit 7c0a191
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions vhdlpp/lexor_keyword.gperf
Expand Up @@ -49,6 +49,7 @@ error, GN_KEYWORD_2008, K_error
exit, GN_KEYWORD_2008, K_exit
failure, GN_KEYWORD_2008, K_failure
fairness, GN_KEYWORD_2008, K_fairness
false, GN_KEYWORD_2008, K_false
file, GN_KEYWORD_2008, K_file
for, GN_KEYWORD_2008, K_for
force, GN_KEYWORD_2008, K_force
Expand Down Expand Up @@ -117,6 +118,7 @@ subtype, GN_KEYWORD_2008, K_subtype
then, GN_KEYWORD_2008, K_then
to, GN_KEYWORD_2008, K_to
transport, GN_KEYWORD_2008, K_transport
true, GN_KEYWORD_2008, K_true
type, GN_KEYWORD_2008, K_type
unaffected, GN_KEYWORD_2008, K_unaffected
units, GN_KEYWORD_2008, K_units
Expand Down
15 changes: 13 additions & 2 deletions vhdlpp/parse.y
Expand Up @@ -272,7 +272,7 @@ static void touchup_interface_for_functions(std::list<InterfacePort*>*ports)
%token K_case K_component K_configuration K_constant K_context K_cover
%token K_default K_disconnect K_downto
%token K_else K_elsif K_end K_entity K_error K_exit
%token K_failure K_fairness K_file K_for K_force K_function
%token K_failure K_fairness K_false K_file K_for K_force K_function
%token K_generate K_generic K_group K_guarded
%token K_if K_impure K_in K_inertial K_inout K_is
%token K_label K_library K_linkage K_literal K_loop
Expand All @@ -285,7 +285,7 @@ static void touchup_interface_for_functions(std::list<InterfacePort*>*ports)
%token K_restrict K_restrict_guarantee K_return K_reverse_range K_rol K_ror
%token K_select K_sequence K_severity K_signal K_shared
%token K_sla K_sll K_sra K_srl K_strong K_subtype
%token K_then K_to K_transport K_type
%token K_then K_to K_transport K_true K_type
%token K_unaffected K_units K_until K_use
%token K_variable K_vmode K_vprop K_vunit
%token K_wait K_warning K_when K_while K_with
Expand Down Expand Up @@ -1827,6 +1827,17 @@ primary
delete[]$1;
$$ = tmp;
}
| K_true
{ ExpBitstring*tmp = new ExpBitstring("1");
FILE_NAME(tmp, @1);
$$ = tmp;
}
| K_false
{ ExpBitstring*tmp = new ExpBitstring("0");
FILE_NAME(tmp, @1);
$$ = tmp;
}

/*XXXX Caught up in element_association_list?
| '(' expression ')'
{ $$ = $2; }
Expand Down

0 comments on commit 7c0a191

Please sign in to comment.