Skip to content

Commit

Permalink
[iss-78]
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 1de50de
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 14:56:28 2024 -0300

    Updated test files.

commit 8e273f8
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 14:55:04 2024 -0300

    Updated utils folder.

commit 99ec8df
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 14:54:38 2024 -0300

    Updated test folder.

commit 47a54ae
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 14:54:05 2024 -0300

    Updated parser folder.

commit a18c598
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 14:53:46 2024 -0300

    Updated mmo folder.

commit 24e3972
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 14:53:27 2024 -0300

    Updated flatter folder.

commit 0c2e2e2
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 14:53:05 2024 -0300

    Updated causalize folder.

commit 194cb1a
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 14:52:39 2024 -0300

    Updated ast folder.

commit 8f8bfec
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 14:51:48 2024 -0300

    Update antialias folder.

commit 9229adb
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 13:46:15 2024 -0300

    Updated util folder.

commit cdc8383
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 13:45:15 2024 -0300

    Updated parser folder.

commit e565972
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 13:44:47 2024 -0300

    Updated mmo folder.

commit 04544a5
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 13:44:15 2024 -0300

    Updated flatter folder.

commit 65d96f9
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 13:43:21 2024 -0300

    Updated causalization folder.

commit c6fc7e0
Author: joaquin.f.fernandez <[email protected]>
Date:   Fri Aug 2 13:40:56 2024 -0300

    Updated AST folder.
  • Loading branch information
joaquinffernandez committed Aug 5, 2024
1 parent 5267139 commit aa48ffd
Show file tree
Hide file tree
Showing 130 changed files with 1,547 additions and 1,507 deletions.
13 changes: 7 additions & 6 deletions antialias/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
******************************************************************************/

#include <iostream>
#include <ast/class.h>
#include <cstdlib>
#include <parser/parser.h>
#include <util/debug.h>
#include <boost/variant/get.hpp>
#include <antialias/remove_alias.h>
#include <cstdlib>
#include <iostream>

#include <antialias/remove_alias.hpp>
#include <ast/class.hpp>
#include <parser/parser.hpp>
#include <util/debug.hpp>

int main(int argc, char** argv)
{
Expand Down
14 changes: 7 additions & 7 deletions antialias/remove_alias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
******************************************************************************/

#include <antialias/remove_alias.h>
#include <ast/equation.h>
#include <ast/queries.h>
#include <antialias/remove_alias.hpp>
#include <ast/equation.hpp>
#include <ast/queries.hpp>
#include <boost/variant/get.hpp>
#include <util/ast_visitors/partial_eval_expression.h>
#include <util/ast_visitors/replace_equation.h>
#include <util/ast_visitors/replace_statement.h>
#include <util/ast_visitors/state_variables_finder.h>
#include <util/ast_visitors/partial_eval_expression.hpp>
#include <util/ast_visitors/replace_equation.hpp>
#include <util/ast_visitors/replace_statement.hpp>
#include <util/ast_visitors/state_variables_finder.hpp>
#include <algorithm>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion antialias/remove_alias.h → antialias/remove_alias.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#ifndef REMOVE_ALIAS_H
#define REMOVE_ALIAS_H
#include <mmo/mmo_class.h>
#include <mmo/mmo_class.hpp>

namespace Modelica {
class RemoveAlias {
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions ast/class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
******************************************************************************/

#include <ast/class.h>
#include <ast/element.h>
#include <ast/class.hpp>
#include <ast/element.hpp>
#include <boost/fusion/include/boost_tuple.hpp>
#include <boost/version.hpp>
#if defined BOOST_VERSION && BOOST_VERSION > 105600
#include <boost/optional/optional_io.hpp>
#endif
#include <boost/variant/get.hpp>
#include <util/debug.h>
#include <util/debug.hpp>

namespace Modelica {
namespace AST {
Expand Down Expand Up @@ -161,7 +161,7 @@ std::ostream& operator<<(std::ostream& out, const EnumClass& c)
out << c.name() << " = enumeration (";
out << c.enum_spec();
out << ")";

return out;
}
member_imp(DerClass, bool, final);
Expand Down
8 changes: 4 additions & 4 deletions ast/class.h → ast/class.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

#ifndef AST_CLASS
#define AST_CLASS
#include <ast/equation.h>
#include <ast/statement.h>
#include <ast/element.h>
#include <ast/expression.h>
#include <ast/equation.hpp>
#include <ast/statement.hpp>
#include <ast/element.hpp>
#include <ast/expression.hpp>

namespace Modelica {
namespace AST {
Expand Down
4 changes: 2 additions & 2 deletions ast/element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
******************************************************************************/

#include <ast/element.h>
#include <ast/class.h>
#include <ast/element.hpp>
#include <ast/class.hpp>
#include <boost/foreach.hpp>
#include <boost/variant/get.hpp>

Expand Down
2 changes: 1 addition & 1 deletion ast/element.h → ast/element.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#ifndef AST_ELEMENT
#define AST_ELEMENT
#include <ast/modification.h>
#include <ast/modification.hpp>

namespace Modelica {
namespace AST {
Expand Down
2 changes: 1 addition & 1 deletion ast/equation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
******************************************************************************/

#include <ast/equation.h>
#include <ast/equation.hpp>

namespace Modelica {
namespace AST {
Expand Down
2 changes: 1 addition & 1 deletion ast/equation.h → ast/equation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#ifndef AST_EQUATION
#define AST_EQUATION
#include <ast/modification.h>
#include <ast/modification.hpp>

namespace Modelica {
namespace AST {
Expand Down
31 changes: 13 additions & 18 deletions ast/expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include <iostream>
#include <sstream>

#include <ast/expression.h>
#include <util/debug.h>
#include <ast/expression.hpp>
#include <util/debug.hpp>

long depth;
namespace Modelica {
Expand Down Expand Up @@ -51,20 +51,20 @@ std::ostream& operator<<(std::ostream& out, const SubAll& s)
order_by_imp(SubAll);

// AddAll
AddAll::AddAll(RefTuple a) : arr_(a){}
AddAll::AddAll(RefTuple a) : arr_(a) {}

member_imp(AddAll, RefTuple, arr);

bool AddAll::operator==(const AddAll &other) const {return (other.arr() == arr());}
std::ostream& operator<<(std::ostream& out, const AddAll &aa){
bool AddAll::operator==(const AddAll& other) const { return (other.arr() == arr()); }
std::ostream& operator<<(std::ostream& out, const AddAll& aa)
{
RefTuple rt = aa.arr();
ExpList inds = get<1>(rt);

out << "sum(" << get<0>(rt) << "[";

ExpList::iterator iti = inds.begin();
for(; std::next(iti) != inds.end(); ++iti)
out << *iti << ", ";
for (; std::next(iti) != inds.end(); ++iti) out << *iti << ", ";

out << *iti << "])";
return out;
Expand Down Expand Up @@ -198,8 +198,7 @@ bool Indexes::operator==(const Indexes& other) const { return other.indexes() ==
order_by_imp(Indexes);

// ForExp
ForExp::ForExp(Expression e, Indexes ind)
: indices_(ind), exp_(e){};
ForExp::ForExp(Expression e, Indexes ind) : indices_(ind), exp_(e){};
std::ostream& operator<<(std::ostream& out, const ForExp& n) // output
{
out << n.exp() << " for " << n.indices();
Expand All @@ -223,8 +222,7 @@ member_imp(Named, Name, name);
order_by_imp(Named);

// UnaryOp
UnaryOp::UnaryOp(Expression e, UnaryOpType op)
: exp_(e), op_(op){};
UnaryOp::UnaryOp(Expression e, UnaryOpType op) : exp_(e), op_(op){};
std::ostream& operator<<(std::ostream& out, const UnaryOp& n) // output
{
if (n.op() == Minus)
Expand All @@ -236,7 +234,7 @@ std::ostream& operator<<(std::ostream& out, const UnaryOp& n) // output
return out;
}
bool UnaryOp::operator==(const UnaryOp& other) const { return other.exp() == exp() && other.op() == op(); }
member_imp(UnaryOp, Expression, exp);
member_imp(UnaryOp, Expression, exp);
member_imp(UnaryOp, UnaryOpType, op);
order_by_imp(UnaryOp);

Expand Down Expand Up @@ -375,12 +373,10 @@ std::ostream& operator<<(std::ostream& out, const Brace& c) // output
return out;
}
bool Brace::operator==(const Brace& other) const { return other.args() == args(); }
member_imp(Brace, ExpList, args)
order_by_imp(Brace);
member_imp(Brace, ExpList, args) order_by_imp(Brace);

// Bracket
Bracket::Bracket(ExpListList args)
: args_(args){};
Bracket::Bracket(ExpListList args) : args_(args){};
std::ostream& operator<<(std::ostream& out, const Bracket& c) // output
{
out << "[";
Expand All @@ -399,8 +395,7 @@ std::ostream& operator<<(std::ostream& out, const Bracket& c) // output
return out;
}
bool Bracket::operator==(const Bracket& other) const { return other.args() == args(); }
member_imp(Bracket, ExpListList, args)
order_by_imp(Bracket);
member_imp(Bracket, ExpListList, args) order_by_imp(Bracket);

Boolean True(TRUE);
Boolean False(FALSE);
Expand Down
2 changes: 1 addition & 1 deletion ast/expression.h → ast/expression.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#ifndef AST_EXPRESSION
#define AST_EXPRESSION
#include <ast/ast_types.h>
#include <ast/ast_types.hpp>
#include <string>
#include <iostream>
#include <vector>
Expand Down
16 changes: 9 additions & 7 deletions ast/modification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
******************************************************************************/

#include <ast/modification.h>
#include <ast/modification.hpp>
#include <boost/variant/get.hpp>

namespace Modelica {
Expand Down Expand Up @@ -125,7 +125,7 @@ std::ostream& operator<<(std::ostream& out, const ShortClass& c) // output
}
}

if(c.enum_spec()) out << c.enum_spec().get();
if (c.enum_spec()) out << c.enum_spec().get();

return out;
}
Expand Down Expand Up @@ -222,8 +222,7 @@ ShortClass::ShortClass(ClassPrefixes cp, Name n, TypePrefixes tp, Name der, Opti
}
enum_spec_ = Option<EnumSpec>();
};
ShortClass::ShortClass(ClassPrefixes cp, Name n, EnumSpec es, Comment comm) :
prefixes_(cp), name_(n), enum_spec_(es), comment_(comm){}
ShortClass::ShortClass(ClassPrefixes cp, Name n, EnumSpec es, Comment comm) : prefixes_(cp), name_(n), enum_spec_(es), comment_(comm) {}
bool ShortClass::operator==(const ShortClass& other) const
{
// TODO
Expand Down Expand Up @@ -272,17 +271,20 @@ std::ostream& operator<<(std::ostream& out, const Comment& c)

member_imp(Enum, Name, name);
member_imp(Enum, Comment, comment);
std::ostream& operator<<(std::ostream &out, const Enum &e){
std::ostream& operator<<(std::ostream& out, const Enum& e)
{
out << e.name() << " " << e.comment();
return out;
}

EnumSpec::EnumSpec(EnumList el) : list_(el){};
member_imp(EnumSpec, EnumList, list);
std::ostream& operator<<(std::ostream &out, const EnumSpec &es){
std::ostream& operator<<(std::ostream& out, const EnumSpec& es)
{
int i = 0, l = es.list().size();

foreach_(Enum e, es.list()){
foreach_(Enum e, es.list())
{
out << e;
if (++i < l) out << ", ";
}
Expand Down
2 changes: 1 addition & 1 deletion ast/modification.h → ast/modification.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#ifndef AST_MODIFICATION
#define AST_MODIFICATION
#include <ast/expression.h>
#include <ast/expression.hpp>

namespace Modelica {
namespace AST {
Expand Down
6 changes: 3 additions & 3 deletions ast/queries.h → ast/queries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#ifndef QUERIES_H
#define QUERIES_H

#include <ast/expression.h>
#include <util/table.h>
#include <util/debug.h>
#include <ast/expression.hpp>
#include <util/table.hpp>
#include <util/debug.hpp>
#include <boost/variant/get.hpp>

namespace Modelica {
Expand Down
2 changes: 1 addition & 1 deletion ast/statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
******************************************************************************/

#include <ast/statement.h>
#include <ast/statement.hpp>

namespace Modelica {
namespace AST {
Expand Down
2 changes: 1 addition & 1 deletion ast/statement.h → ast/statement.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#ifndef AST_STATEMENT
#define AST_STATEMENT
#include <ast/equation.h>
#include <ast/equation.hpp>

namespace Modelica {
namespace AST {
Expand Down
10 changes: 5 additions & 5 deletions causalize/common/for_unrolling/for_index_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
******************************************************************************/

#include <causalize/common/for_unrolling/for_index_iterator.h>
#include <ast/expression.h>
#include <util/ast_visitors/eval_expression.h>
#include <ast/modification.h>
#include <util/debug.h>
#include <causalize/common/for_unrolling/for_index_iterator.hpp>
#include <ast/expression.hpp>
#include <util/ast_visitors/eval_expression.hpp>
#include <ast/modification.hpp>
#include <util/debug.hpp>

namespace Causalize {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
******************************************************************************/

#include <ast/ast_types.h>
#include <ast/expression.h>
#include <util/table.h>
#include <ast/ast_types.hpp>
#include <ast/expression.hpp>
#include <util/table.hpp>

namespace Causalize {
class ForIndexIterator {
Expand Down
10 changes: 5 additions & 5 deletions causalize/common/for_unrolling/process_for_equations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
#include <boost/variant/variant.hpp>
#include <boost/variant/get.hpp>

#include <util/debug.h>
#include <util/table.h>
#include <util/ast_visitors/partial_eval_expression.h>
#include <util/debug.hpp>
#include <util/table.hpp>
#include <util/ast_visitors/partial_eval_expression.hpp>

#include "process_for_equations.h"
#include "for_index_iterator.h"
#include "process_for_equations.hpp"
#include "for_index_iterator.hpp"

namespace Causalize {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
******************************************************************************/

#include <mmo/mmo_class.h>
#include <mmo/mmo_class.hpp>

/**
* Performs a loop unrolling over the for-equations
Expand Down
Loading

0 comments on commit aa48ffd

Please sign in to comment.