Skip to content

Commit ea8c624

Browse files
committed
quick implement of bitwise and (only 2 inputs) in assigns
1 parent 8932e2b commit ea8c624

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

verilog.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,10 +1313,12 @@ VerilogError load_assign(Token** it, ListToken* list_wire, ListToken* list_in, L
13131313
if ( t->classe == SYM_TILDE ) {
13141314
gate->atributos.role = ROLE_NOT;
13151315

1316-
if (!avanca(&t))
1317-
goto load_assign_bad_eof;
1316+
if (!avanca(&t))
1317+
goto load_assign_bad_eof;
13181318
}
13191319

1320+
load_assign_identifiers:
1321+
13201322
if ( !is_allowed_identifier(t) ) {
13211323
show_error_msg("Token inesperado foi encontrado",
13221324
t->linha, t->coluna, "algum identificador", t->valor);
@@ -1354,13 +1356,25 @@ VerilogError load_assign(Token** it, ListToken* list_wire, ListToken* list_in, L
13541356
if (!avanca(&t))
13551357
goto load_assign_bad_eof;
13561358

1357-
if (t->classe != SYM_SEMICOLON) {
1359+
if (t->classe == SYM_SEMICOLON)
1360+
goto load_assign_sucess;
1361+
1362+
if ( gate->atributos.role == ROLE_NOT ||
1363+
gate->atributos.role == ROLE_AND ||
1364+
t->classe != SYM_AMPERSAND ) {
13581365
show_error_msg("Token inesperado foi encontrado",
13591366
t->linha, t->coluna, ";", t->valor);
13601367
goto load_assign_bad_token;
13611368
}
13621369

1363-
//load_assign_sucess:
1370+
gate->atributos.role = ROLE_AND;
1371+
1372+
if (!avanca(&t))
1373+
goto load_assign_bad_eof;
1374+
1375+
goto load_assign_identifiers;
1376+
1377+
load_assign_sucess:
13641378
*it = t;
13651379
return NO_ERROR;
13661380

0 commit comments

Comments
 (0)