From 76ebae7f4f424edc78199a61fc4006666ab98d1d Mon Sep 17 00:00:00 2001 From: Colin Eles Date: Fri, 19 Nov 2010 17:30:42 +0000 Subject: [PATCH] example model git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/trunk/TableTool@6560 57e6efec-57d4-0310-aeb1-a6c144bb1a8b --- @CVC_checker/pvs_to_cvc_subtypes.m | 18 ++++++++++++++++-- @GUI/textbox_callback.m | 7 +++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/@CVC_checker/pvs_to_cvc_subtypes.m b/@CVC_checker/pvs_to_cvc_subtypes.m index ed79aa0..c0346d0 100644 --- a/@CVC_checker/pvs_to_cvc_subtypes.m +++ b/@CVC_checker/pvs_to_cvc_subtypes.m @@ -2,19 +2,33 @@ function [ cvc_type ] = pvs_to_cvc_subtypes( pvs_type ) %PVS_TO_CVC_SUBTYPES Summary of this function goes here % Detailed explanation goes here + + + %pvs_type is parsed string = char(pvs_type); + +% change cases +string = regexprep(string,'real','REAL'); +string = regexprep(string,'Real','REAL'); +string = regexprep(string,'int','INT'); +string = regexprep(string,'Int','INT'); +string = regexprep(string,'bool','BOOLEAN'); +string = regexprep(string,'Bool','BOOLEAN'); +string = regexprep(string,'BOOL[^EAN]','BOOLEAN'); + % remove brackets string_no_brack = regexp(string,'(?<=\{)[^\n]*(?=\})','match'); if isempty(string_no_brack) - cvc_type = pvs_type; + + cvc_type = {string}; return end split_at_pipe = regexp(char(string_no_brack),'\|','split'); if (size(split_at_pipe,2) ~= 2) %something strange happened - cvc_type = pvs_type; + cvc_type = {string}; return; end diff --git a/@GUI/textbox_callback.m b/@GUI/textbox_callback.m index f12db25..4e50b1a 100644 --- a/@GUI/textbox_callback.m +++ b/@GUI/textbox_callback.m @@ -17,6 +17,13 @@ end if((strcmp(event.Character,'r')) && (strcmp(char(event.Modifier),'command') || strcmp(char(event.Modifier),'control'))) return end + +if strcmp(event.Key,'tab') + event.Character = ''; + return; +end + + if(~isempty(unicode2native(event.Character))) % make sure the character is a printable character if event.Character > 33 || event.Character == 8 -- GitLab