interface grammar{@Terminal}domains
parseTree = parseTree(
symbol Nonterminal,
argumentParseTree*ArgParseTreeList).
argumentParseTree =
argParseTree(parseTree);
argTerminal(@Terminal).
end interface grammar
%------------implement main
open grammar{string}clauses
run():-
console::init(),ParseTree= parseTree("verum",[argTerminal("true")]),
stdIo::write(ParseTree).
end implement main
goal
mainExe::run(main::run).
then the call to stdIo::write/0... throws an access violation. Probably it's a bug?
interface grammar{@Terminal}domains
parseTree{T}= parseTree(
symbol Nonterminal,
argumentParseTree{T}*ArgParseTreeList).
argumentParseTree{T}=
argParseTree(parseTree{T});
argTerminal(T).
predicates
printGrammar :(parseTree{@Terminal}Grammar).
end interface grammar
I.e. the domain uses a normal type parameter, but in the predicate declaration(s) you will instantiate the domain with the interface parameter (i.e. @Terminal).
Maybe the origin of the problem is not in stdIo::write/0..., because with my type declaration (not with your work around) the compiler complaines about type incompatibility in