Ignore:
Timestamp:
Apr 4, 2023, 2:25:52 PM (19 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
beeff61e, e02e13f
Parents:
4541b09
Message:

Translated parser to the new ast. This incuded a small fix in the resolver so larger expressions can be used in with statements and some updated tests. errors/declaration just is a formatting update. attributes now actually preserves more attributes (unknown if all versions work).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypeData.h

    r4541b09 rbb7422a  
    99// Author           : Peter A. Buhr
    1010// Created On       : Sat May 16 15:18:36 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Feb 24 14:25:02 2023
    13 // Update Count     : 205
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Mar  1 10:44:00 2023
     13// Update Count     : 206
    1414//
    1515
     
    2020#include <string>                                                                               // for string
    2121
     22#include "AST/Type.hpp"                                                                 // for Type
    2223#include "ParseNode.h"                                                                  // for DeclarationNode, DeclarationNode::Ag...
    23 #include "SynTree/LinkageSpec.h"                                                // for Spec
    24 #include "SynTree/Type.h"                                                               // for Type, ReferenceToType (ptr only)
    25 #include "SynTree/SynTree.h"                                                    // for Visitor Nodes
    2624
    2725struct TypeData {
     
    3028
    3129        struct Aggregate_t {
    32                 AggregateDecl::Aggregate kind;
     30                ast::AggregateDecl::Aggregate kind;
    3331                const std::string * name = nullptr;
    3432                DeclarationNode * params = nullptr;
     
    4139        };
    4240
    43         struct AggInst_t {                                                                      // handles SUE
     41        struct AggInst_t {
    4442                TypeData * aggregate = nullptr;
    4543                ExpressionNode * params = nullptr;
     
    9391        DeclarationNode::BuiltinType builtintype = DeclarationNode::NoBuiltinType;
    9492
    95         Type::Qualifiers qualifiers;
     93        ast::CV::Qualifiers qualifiers;
    9694        DeclarationNode * forall = nullptr;
    9795
     
    114112};
    115113
    116 Type * typebuild( const TypeData * );
     114ast::Type * typebuild( const TypeData * );
    117115TypeData * typeextractAggregate( const TypeData * td, bool toplevel = true );
    118 Type::Qualifiers buildQualifiers( const TypeData * td );
    119 Type * buildBasicType( const TypeData * );
    120 PointerType * buildPointer( const TypeData * );
    121 ArrayType * buildArray( const TypeData * );
    122 ReferenceType * buildReference( const TypeData * );
    123 AggregateDecl * buildAggregate( const TypeData *, std::list< Attribute * > );
    124 ReferenceToType * buildComAggInst( const TypeData *, std::list< Attribute * > attributes, LinkageSpec::Spec linkage );
    125 ReferenceToType * buildAggInst( const TypeData * );
    126 TypeDecl * buildVariable( const TypeData * );
    127 EnumDecl * buildEnum( const TypeData *, std::list< Attribute * >, LinkageSpec::Spec );
    128 TypeInstType * buildSymbolicInst( const TypeData * );
    129 TupleType * buildTuple( const TypeData * );
    130 TypeofType * buildTypeof( const TypeData * );
    131 VTableType * buildVtable( const TypeData * );
    132 Declaration * buildDecl(
    133         const TypeData *, const std::string &, Type::StorageClasses, Expression *,
    134         Type::FuncSpecifiers funcSpec, LinkageSpec::Spec, Expression * asmName,
    135         Initializer * init = nullptr, std::list< class Attribute * > attributes = std::list< class Attribute * >() );
    136 FunctionType * buildFunction( const TypeData * );
    137 Declaration * addEnumBase( Declaration *, const TypeData * );
     116ast::CV::Qualifiers buildQualifiers( const TypeData * td );
     117ast::Type * buildBasicType( const TypeData * );
     118ast::PointerType * buildPointer( const TypeData * );
     119ast::ArrayType * buildArray( const TypeData * );
     120ast::ReferenceType * buildReference( const TypeData * );
     121ast::AggregateDecl * buildAggregate( const TypeData *, std::vector<ast::ptr<ast::Attribute>> );
     122ast::BaseInstType * buildComAggInst( const TypeData *, std::vector<ast::ptr<ast::Attribute>> && attributes, ast::Linkage::Spec linkage );
     123ast::BaseInstType * buildAggInst( const TypeData * );
     124ast::TypeDecl * buildVariable( const TypeData * );
     125ast::EnumDecl * buildEnum( const TypeData *, std::vector<ast::ptr<ast::Attribute>> &&, ast::Linkage::Spec );
     126ast::TypeInstType * buildSymbolicInst( const TypeData * );
     127ast::TupleType * buildTuple( const TypeData * );
     128ast::TypeofType * buildTypeof( const TypeData * );
     129ast::VTableType * buildVtable( const TypeData * );
     130ast::Decl * buildDecl(
     131        const TypeData *, const std::string &, ast::Storage::Classes, ast::Expr *,
     132        ast::Function::Specs funcSpec, ast::Linkage::Spec, ast::Expr * asmName,
     133        ast::Init * init = nullptr, std::vector<ast::ptr<ast::Attribute>> && attributes = std::vector<ast::ptr<ast::Attribute>>() );
     134ast::FunctionType * buildFunctionType( const TypeData * );
     135ast::Decl * addEnumBase( Declaration *, const TypeData * );
    138136void buildKRFunction( const TypeData::Function_t & function );
    139137
Note: See TracChangeset for help on using the changeset viewer.