From b21c1e496ddb76ce23524cf4096c4a30bb4494ac Mon Sep 17 00:00:00 2001 From: Jan Tusil Date: Tue, 30 Apr 2019 11:19:10 +0200 Subject: [PATCH] show reference types --- semantics/cpp/language/common/dynamic.k | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/semantics/cpp/language/common/dynamic.k b/semantics/cpp/language/common/dynamic.k index 4b1cb37f8..4034a118e 100644 --- a/semantics/cpp/language/common/dynamic.k +++ b/semantics/cpp/language/common/dynamic.k @@ -894,6 +894,10 @@ module CPP-DYNAMIC-OTHER rule showCPPType(pointerType(T::CPPType)) => showCPPType("", pointerType(T)) + rule showCPPType(lvRefType(T::CPPType)) => showCPPType("", lvRefType(T)) + + rule showCPPType(rvRefType(T::CPPType)) => showCPPType("", rvRefType(T)) + rule showCPPType(classType(N:Namespace :: Class(_, X::CId, .TemplateArgs))) => showNamespace(N) +String showCId(X) @@ -905,6 +909,12 @@ module CPP-DYNAMIC-OTHER rule showCPPType(DDL::String, pointerType(T::CPPType)) => showCPPType(parens(T, "*" +String DDL), simpleType(T)) + rule showCPPType(DDL::String, lvRefType(T::CPPType)) + => showCPPType(parens(T, "&" +String DDL), simpleType(T)) + + rule showCPPType(DDL::String, rvRefType(T::CPPType)) + => showCPPType(parens(T, "&&" +String DDL), simpleType(T)) + rule showCPPType(DDL::String, T::CPPSimpleType) => showCPPType(T) +String " " +String DDL [owise]