Skip to content

feat: Implementei a estrutura de dados da tabela de simbolos#94

Merged
Bappoz merged 1 commit into
developerfrom
feat/issue11-tabela-de-simbolos
May 26, 2026
Merged

feat: Implementei a estrutura de dados da tabela de simbolos#94
Bappoz merged 1 commit into
developerfrom
feat/issue11-tabela-de-simbolos

Conversation

@Bappoz
Copy link
Copy Markdown
Owner

@Bappoz Bappoz commented May 25, 2026

This pull request introduces significant improvements to the parser and semantic analysis infrastructure, with a focus on handling sizeof expressions, type casting, and introducing a robust symbol table for semantic checks. It also adds comprehensive tests to ensure correctness of parsing, symbol table behavior, and special character handling. The main changes are grouped below

Parser and AST Enhancements

  • Added a new Expr::SizeofType(QualifierType, Span) variant to the AST to distinguish between sizeof(type) and sizeof(expr), and updated the parser logic to correctly parse both forms.
  • Removed unnecessary expression terminator checks in the parser, simplifying expression parsing and error handling.

Symbol Table and Semantic Analysis

  • Introduced a symbol_table module implementing a scoped symbol table with support for declaration, lookup, shadowing, and redeclaration error detection.
  • Extended SemanticErrorKind with a Redeclaration variant and improved error reporting for redeclaration cases.

Testing Improvements

  • Added comprehensive tests for the symbol table, covering lookups, shadowing, redeclaration, scope management, and qualifiers.
  • Enhanced parser tests to verify correct parsing of cast expressions, sizeof in both forms, and binary operations following these constructs.
  • Added new tests for UTF-8 character boundary handling and memory-mapped file source input.

@Bappoz Bappoz requested review from guxvr and matheuslemesam May 25, 2026 16:05
@Bappoz Bappoz self-assigned this May 25, 2026
@Bappoz Bappoz changed the title feat: implemented symbol tables and tests feat: Implementei a estrutura de dados da tabela de simbolos May 26, 2026
@Bappoz
Copy link
Copy Markdown
Owner Author

Bappoz commented May 26, 2026

Ninguem corrije ent corriji e aceite

@Bappoz Bappoz merged commit c8bc4a5 into developer May 26, 2026
1 check passed
@Bappoz Bappoz deleted the feat/issue11-tabela-de-simbolos branch May 26, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SEMANTIC 00] Implementar a estrutura de dados da tabela de símbolos com escopo léxico

1 participant