source: src/AST/ParseNode.hpp @ 1867c96

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 1867c96 was 87701b6, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

Tentative fix for increment/decrement and implented a few more visits

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[2bb4a01]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// ParseNode.hpp --
8//
9// Author           : Aaron B. Moss
10// Created On       : Wed May 8 11:00:00 2019
11// Last Modified By : Aaron B. Moss
12// Last Modified On : Wed May 8 11:00:00 2019
13// Update Count     : 1
14//
15
16#pragma once
17
18#include "Node.hpp"
19
20#include "Common/CodeLocation.h"
21
22namespace ast {
23
[e0115286]24/// AST node with an included source location
25class ParseNode : public Node {
26public:
27        CodeLocation location;
[2bb4a01]28
[e0115286]29        // Default constructor is deliberately omitted, all ParseNodes must have a location.
30        // Escape hatch if needed is to explicitly pass a default-constructed location, but
31        // this should be used sparingly.
[2bb4a01]32
[e0115286]33        ParseNode( const CodeLocation& loc ) : Node(), location(loc) {}
[2bb4a01]34
[e0115286]35        ParseNode( const ParseNode& o ) = default;
[87701b6]36private:
37        ParseNode * clone() const override = 0;
[2bb4a01]38
[87701b6]39        /// Must be copied in ALL derived classes
40        template<typename node_t>
41        friend node_t * mutate(const node_t * node);
42};
[e0115286]43
[2bb4a01]44}
45
46// Local Variables: //
47// tab-width: 4 //
48// mode: c++ //
49// compile-command: "make install" //
50// End: //
Note: See TracBrowser for help on using the repository browser.