Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@396 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
- Loading branch information
x97davka
committed
Sep 9, 1998
1 parent
bb73d7b
commit 09be46e
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# Makefile for modeq/runtime | ||
# | ||
# David Kĺgedal <x97davka@ida.liu.se> | ||
# | ||
# $Id$ | ||
# | ||
|
||
RMLINCLUDE = /home/pelab/pub/pkg/rml/current/sol2-sparc/include/plain | ||
|
||
SHELL = /bin/sh | ||
CC = cc | ||
CFLAGS = -I$(RMLINCLUDE) | ||
|
||
SRC = rtopts.c | ||
|
||
OBJ = $(SRC:.c=.o) | ||
|
||
all: $(OBJ) | ||
|
||
clean: | ||
$(RM) $(OBJ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
#include <stdio.h> | ||
#include "rml.h" | ||
#include "../ast/yacclib.h" | ||
#include <errno.h> | ||
|
||
static int type_info; | ||
|
||
void RTOpts_5finit(void) | ||
{ | ||
type_info = 0; | ||
} | ||
|
||
RML_BEGIN_LABEL(RTOpts__args) | ||
{ | ||
void *args = rmlA0; | ||
void *res = mk_nil(); | ||
|
||
while (RML_GETHDR(args) != RML_NILHDR) | ||
{ | ||
char *arg = RML_STRINGDATA(RML_CAR(args)); | ||
printf("Arg: %s\n", arg); | ||
if (arg[0] == '+') | ||
{ | ||
printf("Option %s\n", arg+1); | ||
if (strlen(arg) < 2) | ||
{ | ||
fprintf(stderr, "# Unknown option: -\n"); | ||
RML_TAILCALLK(rmlFC); | ||
} | ||
switch (arg[1]) { | ||
case 't': | ||
type_info = 1; | ||
break; | ||
default: | ||
fprintf(stderr, "# Unknown option: %s\n", arg); | ||
RML_TAILCALLK(rmlFC); | ||
} | ||
} | ||
else | ||
res = mk_cons(RML_CAR(args), res); | ||
args = RML_CDR(args); | ||
} | ||
|
||
rmlA0 = res; | ||
RML_TAILCALLK(rmlSC); | ||
} | ||
RML_END_LABEL | ||
|
||
RML_BEGIN_LABEL(RTOpts__typeinfo) | ||
{ | ||
rmlA0 = RML_PRIM_MKBOOL(type_info); | ||
RML_TAILCALLK(rmlSC); | ||
} | ||
RML_END_LABEL |