Skip to content

Commit

Permalink
More work on arrays.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@730 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
ankar committed Feb 13, 2002
1 parent 0d8feb1 commit 5fd7b2b
Show file tree
Hide file tree
Showing 12 changed files with 1,045 additions and 247 deletions.
4 changes: 2 additions & 2 deletions mosh/src/Makefile
Expand Up @@ -25,7 +25,7 @@ LIBS = -lantlr -lmodelica_parser -lreadline -ltermcap
PARSER_OBJS = ../../modelica_parser/src/modelica_lexer.o ../../modelica_parser/src/token_names.o ../../modelica_parser/src/parse_tree_dumper.o

HELPER_OBJS = value.o symboltable.o builtin_function.o \
modelica_function.o compiled_function.o function_argument.o
modelica_function.o compiled_function.o function_argument.o modelica_type.o

parsergen= modelica_expression_parser.cpp modelica_expression_parser.hpp \
modelica_expression_parserTokenTypes.hpp modelica_expression_parserTokenTypes.txt
Expand Down Expand Up @@ -57,7 +57,7 @@ mosh : $(OBJS)
$(parsergen): expandedexpression_parser.g
java antlr.Tool $(ANTLRFLAGS) expandedexpression_parser.g

$(walkergen): walker.g modelica_expression_parserTokenTypes.txt
$(walkergen): walker.g modelica_expression_parserTokenTypes.txt runtime/modelica_array.hpp runtime/numerical_array.hpp
java antlr.Tool $(ANTLRFLAGS) walker.g
#$<

Expand Down
24 changes: 12 additions & 12 deletions mosh/src/builtin_function.cpp
Expand Up @@ -47,10 +47,10 @@ bool builtin_function::match_formal_parameters(value args)

abs_t::abs_t()
{
type_s t;
t.insert(value::real);
t.insert(value::integer);
m_formal_parameters.push_back(t);
// type_s t;
// t.insert(create_real());
// t.insert(create_integer());
// m_formal_parameters.push_back(t);
}


Expand Down Expand Up @@ -155,10 +155,10 @@ value sign_t::do_apply(value args)

ceil_t::ceil_t()
{
type_s t;
t.insert(value::real);
// t.insert(value::integer);
m_formal_parameters.push_back(t);
// type_s t;
// t.insert(create_real());
// // t.insert(value::integer);
// m_formal_parameters.push_back(t);
}

ceil_t::~ceil_t()
Expand All @@ -178,10 +178,10 @@ value ceil_t::do_apply(value args)

floor_t::floor_t()
{
type_s t;
t.insert(value::real);
// t.insert(value::integer);
m_formal_parameters.push_back(t);
// type_s t;
// t.insert(create_real());
// // t.insert(value::integer);
// m_formal_parameters.push_back(t);
}

floor_t::~floor_t()
Expand Down
4 changes: 3 additions & 1 deletion mosh/src/builtin_function.hpp
Expand Up @@ -2,6 +2,7 @@
#define BUILTIN_FUNCTION_HPP_

#include "modelica_function.hpp"
#include "modelica_type.hpp"
#include "runtime/modelica_runtime_error.hpp"
#include "value.hpp"
#include <string>
Expand All @@ -13,7 +14,8 @@ class builtin_function : public modelica_function
virtual ~builtin_function();

protected:
typedef std::set<value::type_en> type_s;
// typedef std::set<value::type_en> type_s;
typedef std::set<modelica_type> type_s;
typedef std::vector<type_s>::iterator formal_parameter_iterator;

protected:
Expand Down
4 changes: 2 additions & 2 deletions mosh/src/modelica_function.cpp
Expand Up @@ -28,11 +28,11 @@ value modelica_function::apply(value args)
if (args.is_array())
{

cout << "an array " << args.type() << endl;
// cout << "an array " << args.type() << endl;
}
else
{
cout << "not an array " << args.type() << endl;
//cout << "not an array " << args.type() << endl;
}
}

Expand Down

0 comments on commit 5fd7b2b

Please sign in to comment.