source: src/Parser/InitializerNode.hpp @ 4558df2

Last change on this file since 4558df2 was c92bdcc, checked in by Andrew Beach <ajbeach@…>, 6 months ago

Updated the rest of the names in src/ (except for the generated files).

  • Property mode set to 100644
File size: 1.6 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// InitializerNode.hpp --
8//
9// Author           : Andrew Beach
10// Created On       : Wed Apr  5 11:31:00 2023
11// Last Modified By : Andrew Beach
12// Last Modified On : Wed Apr  5 11:48:00 2023
13// Update Count     : 0
14//
15
16#pragma once
17
18#include "ParseNode.hpp"
19
20struct InitializerNode final : public ParseList<InitializerNode> {
21        InitializerNode( ExpressionNode *, bool aggrp = false, ExpressionNode * des = nullptr );
22        InitializerNode( InitializerNode *, bool aggrp = false, ExpressionNode * des = nullptr );
23        InitializerNode( bool isDelete );
24        ~InitializerNode();
25        virtual InitializerNode * clone() const { assert( false ); return nullptr; }
26
27        ExpressionNode * get_expression() const { return expr; }
28
29        InitializerNode * set_designators( ExpressionNode * des ) { designator = des; return this; }
30        ExpressionNode * get_designators() const { return designator; }
31
32        InitializerNode * set_maybeConstructed( bool value ) { maybeConstructed = value; return this; }
33        bool get_maybeConstructed() const { return maybeConstructed; }
34
35        bool get_isDelete() const { return isDelete; }
36
37        InitializerNode * next_init() const { return kids; }
38
39        void print( std::ostream & os, int indent = 0 ) const;
40        void printOneLine( std::ostream & ) const;
41
42        virtual ast::Init * build() const;
43private:
44        ExpressionNode * expr;
45        bool aggregate;
46        ExpressionNode * designator;                        // may be list
47        InitializerNode * kids;
48        bool maybeConstructed;
49        bool isDelete;
50}; // InitializerNode
Note: See TracBrowser for help on using the repository browser.