souffle  2.0.2-371-g6315b36
RecordInit.h
Go to the documentation of this file.
1 /*
2  * Souffle - A Datalog Compiler
3  * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved
4  * Licensed under the Universal Permissive License v 1.0 as shown at:
5  * - https://opensource.org/licenses/UPL
6  * - <souffle root>/licenses/SOUFFLE-UPL.txt
7  */
8 
9 /************************************************************************
10  *
11  * @file RecordInit.h
12  *
13  * Defines the record initialization class
14  *
15  ***********************************************************************/
16 
17 #pragma once
18 
19 #include "ast/Argument.h"
20 #include "ast/Node.h"
21 #include "ast/Term.h"
22 #include "parser/SrcLocation.h"
25 #include <ostream>
26 #include <string>
27 #include <utility>
28 #include <vector>
29 
30 namespace souffle::ast {
31 
32 /**
33  * @class RecordInit
34  * @brief Defines a record initialization class
35  */
36 class RecordInit : public Term {
37 public:
38  RecordInit(VecOwn<Argument> operands = {}, SrcLocation loc = {})
39  : Term(std::move(operands), std::move(loc)) {}
40 
41  RecordInit* clone() const override {
43  }
44 
45 protected:
46  void print(std::ostream& os) const override {
47  os << "[" << join(args) << "]";
48  }
49 };
50 
51 } // namespace souffle::ast
souffle::ast::Term::args
VecOwn< Argument > args
Arguments.
Definition: Term.h:86
souffle::ast::RecordInit::RecordInit
RecordInit(VecOwn< Argument > operands={}, SrcLocation loc={})
Definition: RecordInit.h:44
SrcLocation.h
Argument.h
souffle::clone
auto clone(const std::vector< A * > &xs)
Definition: ContainerUtil.h:172
ContainerUtil.h
Term.h
souffle::join
detail::joined_sequence< Iter, Printer > join(const Iter &a, const Iter &b, const std::string &sep, const Printer &p)
Creates an object to be forwarded to some output stream for printing sequences of elements interspers...
Definition: StreamUtil.h:175
souffle::ast::RecordInit::print
void print(std::ostream &os) const override
Output to a given output stream.
Definition: RecordInit.h:52
Node.h
StreamUtil.h
souffle::ast::RecordInit::clone
RecordInit * clone() const override
Create clone.
Definition: RecordInit.h:47
souffle::ast::Node::getSrcLoc
const SrcLocation & getSrcLoc() const
Return source location of the Node.
Definition: Node.h:46
souffle::ast
Definition: Aggregator.h:35
souffle::ast::Term::Term
Term(Operands &&... operands)
Definition: Term.h:45