source: src/Parser/InitializerNode.h@ 044ae62

ADT
Last change on this file since 044ae62 was c468150, checked in by Andrew Beach <ajbeach@…>, 2 years ago

Split up ParseNode.h so that headers match implementation. May have a bit less to include total because of it.

  • 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.h --
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.h"
19
20class InitializerNode : public ParseNode {
21public:
22 InitializerNode( ExpressionNode *, bool aggrp = false, ExpressionNode * des = nullptr );
23 InitializerNode( InitializerNode *, bool aggrp = false, ExpressionNode * des = nullptr );
24 InitializerNode( bool isDelete );
25 ~InitializerNode();
26 virtual InitializerNode * clone() const { assert( false ); return nullptr; }
27
28 ExpressionNode * get_expression() const { return expr; }
29
30 InitializerNode * set_designators( ExpressionNode * des ) { designator = des; return this; }
31 ExpressionNode * get_designators() const { return designator; }
32
33 InitializerNode * set_maybeConstructed( bool value ) { maybeConstructed = value; return this; }
34 bool get_maybeConstructed() const { return maybeConstructed; }
35
36 bool get_isDelete() const { return isDelete; }
37
38 InitializerNode * next_init() const { return kids; }
39
40 void print( std::ostream & os, int indent = 0 ) const;
41 void printOneLine( std::ostream & ) const;
42
43 virtual ast::Init * build() const;
44private:
45 ExpressionNode * expr;
46 bool aggregate;
47 ExpressionNode * designator; // may be list
48 InitializerNode * kids;
49 bool maybeConstructed;
50 bool isDelete;
51}; // InitializerNode
Note: See TracBrowser for help on using the repository browser.