REVO2700 $ ExpressionParserDemonstrator " HH $ o 0 /******************************************************************************* * Copyright (c) 2009 Andreas Rozek * * * * Permission is hereby granted, free of charge, to any person obtaining a copy * * of this software and associated documentation files (the "Software"),to deal * * in the Software without restriction, including without limitation the rights * * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is fur- * * nished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included in * * all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIA- * * BILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * * THE SOFTWARE. * * * * Additionally, any modifications to the original Software must be clearly * * marked in a way, that the original author will never be considered as the * * author of these modifications! * *******************************************************************************/ global ApplicationPath -------------------------------------------------------------------------------- -- preOpenStack prepares this stack for being opened -- -------------------------------------------------------------------------------- on preOpenStack choose browse tool switch (the platform) case "Win32" revSetStackProfile "Win32" break case "Linux" revSetStackProfile "Linux" break default # MacOS X is the "Master" revSetStackProfile "Master" end switch # **** "install" the actual expression parser **** start using stack "ExpressionParser" end preOpenStack 4 ExpressionParser Demonstrator I/Users/andreas/Rozek/Runtime Revolution/ExpressionParser/FileInfo.bundle U Arial U Arial W Arial W Arial W Arial U Lucida Grande U Courier U Verdana U Courier New U Tahoma W Courier New U Lucida Grande cREVTempMaster -windowManagerPlace falsemenubar linkHiliteColor blendLevel 0 cantAbort false maxWidth 65535rect 111,135,623,439 patterns 1003 colors 255,255,255 decorations defaulticonic falselinkVisitedColor shadow truecantDelete trueid 1059altId 0 hcAddressing falsestartUpIconic falsewindowShape 0title ExpressionParser Demonstrator linkColor cantModify false textStyle plain maxHeight 65535underlineLinks style topleveldestroyWindow false liveresizing false password scroll 0 behavior passkey icon 0name ExpressionParserDemonstrator resizable false alwaysBuffer falseformatForPrinting falsevisible truemetal false minWidth 32 destroyStack true textSize 12 textFont Arial dynamicPaths false minHeight 32 cREVMaster cREVDivergedLinux cREVDivergedWin32 cREVDivergedWindows cREVGeometryCache stackID 1059 cREVGeneral profile Masterbreakpoints breakpointstates debugParameters profileList debugEntryHandler M,preOpenStackbreakpointconditions scripteditorvscroll 0scripteditorselection 2637stackfileversion 2.7masterName Master MainCard IP-------------------------------------------------------------------------------- -- openCard initializes this card -- -------------------------------------------------------------------------------- on openCard put empty into field "ExpressionEntry" set the enabled of button "EvaluationButton" to false put empty into field "ResultView" end openCard 0 cREVTempMaster ink srcCopydontSearch falsemark falsethreeD trueblendLevel 0rect 0,0,512,304defaultButton patterns colors cantDelete trueid 1019altId 0 textStyle behavior name MainCardlayer 1borderWidth 2showBorder false textSize textFont cREVTable acell false cREVGeneral scripteditorvscroll 0scripteditorselection 853 cREVGeometryCacheIDs 1254396624150 10101254399262213 10291254398971405 10211254396391232 10051254397366554 10111254396546676 10081254399031093 10231254400221922 10371254399363107 10311255540266730 1059 cREVGeometrycache total 10order $ # HeaderGroup v cREVTempMaster &traversalOn falseink srcCopydontSearch false boundingRect scrollbarWidth 20threeD falseblendLevel 0rect -4,-4,514,114 patterns colors showName falsehScroll 0backgroundBehavior truecantDelete truevScrollbar falsehScrollbar falsetabGroupBehavior falseid 1011altId 0radioBehavior false textStyle lockLoc falselabel behavior name HeaderGrouptoolTip layer 1borderWidth 2cantSelect falsevisible truemargins 4opaque falseshowBorder false disabled false textSize textFont vScroll 0hilitedButton 0 cREVGeneral revUniqueID 1254397366554 TitleLabel @ @ cREVTempMaster 7 tabStops traversalOn falsefirstIndent 0ink srcCopydontSearch falsescrollbarWidth 20threeD falsetoggleHilites falseblendLevel 0multipleHilites falserect 0,0,320,28textHeight 24 patterns colors shadow falsehScroll 0 textAlign leftvScrollbar falsehScrollbar falseid 1005altId 0autoTab falsehGrid false textStyle bold dontWrap truelockLoc falseautoHilite falsestyle transparentsharedText true showLines falsenoncontiguousHilites false lockText truescroll 0 behavior name TitleLabeltoolTip listBehavior falsevGrid falselayer 2borderWidth 2cantSelect falsevisible truemargins 4 htmlText $
ExpressionParser Demonstrator
opaque false threeDHilite false shadowOffset 4showBorder false disabled false textSize 18fixedLineHeight false textFont ArialvScroll 0 hilitedLines showFocusBorder false cREVMaster layer 2rect 0,0,226,28 cREVDivergedWin32 layer 3rect 0,2,226,30 cREVTable currentview ExpressionParser Demonstrator cREVGeneral profile MasterrevUniqueID 1254396391232masterName MasterprofileList Win32 ExpressionParser Demonstrator TitleSeparator @ cREVTempMaster 7 tabStops traversalOn falsefirstIndent 0ink srcCopydontSearch falsescrollbarWidth 20threeD truetoggleHilites falseblendLevel 0multipleHilites falserect 2,26,510,28textHeight patterns colors shadow falsehScroll 0 textAlign rightvScrollbar falsehScrollbar falseid 1008altId 0autoTab falsehGrid false textStyle dontWrap truelockLoc falseautoHilite falsestyle transparentsharedText true showLines falsenoncontiguousHilites false lockText truescroll 0 behavior name TitleSeparatortoolTip listBehavior falsevGrid falselayer 3borderWidth 1cantSelect falsevisible truemargins 8 htmlText opaque false threeDHilite false shadowOffset 4showBorder true disabled false textSize fixedLineHeight false textFont vScroll 0 hilitedLines showFocusBorder false cREVTable currentview cREVGeneral revUniqueID 1254396546676 InstructionView @ N cREVTempMaster 7 tabStops traversalOn falsefirstIndent 0ink srcCopydontSearch falsescrollbarWidth 20threeD falsetoggleHilites falseblendLevel 0multipleHilites falserect 2,32,510,110textHeight patterns colors shadow falsehScroll 0 textAlign leftvScrollbar falsehScrollbar falseid 1010altId 0autoTab falsehGrid false textStyle dontWrap falselockLoc falseautoHilite falsestyle transparentsharedText true showLines falsenoncontiguousHilites false lockText truescroll 0 behavior name InstructionViewtoolTip listBehavior falsevGrid falselayer 4borderWidth 2cantSelect falsevisible truemargins 4 htmlText NThis little application tests the "ExpressionParser", a small "library stack" which parses and evaluates numeric expressions. Please enter such an expression into the upper field and press "Evaluate". The lower field will then show either an error message or the outcome of the evaluation.
opaque false threeDHilite false shadowOffset 4showBorder false disabled false textSize fixedLineHeight true textFont vScroll 0 hilitedLines showFocusBorder false cREVTable currentview NThis little application tests the "ExpressionParser", a small "library stack" which parses and evaluates numeric expressions. Please enter such an expression into the upper field and press "Evaluate". The lower field will then show either an error message or the outcome of the evaluation.
cREVGeneral revUniqueID 1254396624150 *This little application tests the "ExpressionParser", a small "library stack" which parses and evaluates numeric expressions. Please enter such an expression into the upper field and press "Evaluate". The lower field will then show either an error message or the outcome of the evaluation. Label Field @ l X cREVTempMaster 7 tabStops traversalOn falsefirstIndent 0ink srcCopydontSearch falsescrollbarWidth 20threeD falsetoggleHilites falseblendLevel 0multipleHilites falserect 2,108,90,129textHeight 16 patterns colors shadow falsehScroll 0 textAlign leftvScrollbar falsehScrollbar falseid 1021altId 0autoTab falsehGrid false textStyle bold dontWrap truelockLoc falseautoHilite falsestyle transparentsharedText true showLines falsenoncontiguousHilites false lockText truescroll 0 behavior name Label FieldtoolTip listBehavior falsevGrid falselayer 5borderWidth 2cantSelect falsevisible truemargins 4 htmlTextExpression:
opaque false threeDHilite false shadowOffset 4showBorder false disabled false textSize 12fixedLineHeight true textFont ArialvScroll 0 hilitedLines showFocusBorder false cREVTable currentview Expression: cREVGeneral revUniqueID 1254398971405 Expression: ExpressionEntry )x }-------------------------------------------------------------------------------- -- various handlers checking if "FileSpecEntry" is empty -- -------------------------------------------------------------------------------- command checkContents set the enabled of button "EvaluationButton" to ( \ the text of me is not empty \ ) end checkContents on CutKey send "checkContents" to me in 0 seconds end CutKey on EnterInField checkContents if (the enabled of button "EvaluationButton" is true) then send "MouseUp 1" to button "EvaluationButton" end if end EnterInField on PasteKey send "checkContents" to me in 0 seconds end PasteKey on RawKeyUp checkContents end RawKeyUp on ReturnInField checkContents if (the enabled of button "EvaluationButton" is true) then send "MouseUp 1" to button "EvaluationButton" end if end ReturnInField P h H enter a numeric expression cREVTempMaster 7 tabStops traversalOn truefirstIndent 0ink srcCopydontSearch falsescrollbarWidth 20threeD truetoggleHilites falseblendLevel 0multipleHilites falserect 80,104,504,176textHeight 16 patterns colors 0,0,0 shadow falsehScroll 0 textAlign leftvScrollbar falsehScrollbar falseid 1023altId 0autoTab falsehGrid false textStyle plain dontWrap falselockLoc falseautoHilite truestyle rectanglesharedText false showLines falsenoncontiguousHilites false lockText falsescroll 0 behavior name ExpressionEntrytoolTip enter a numeric expression listBehavior falsevGrid falselayer 6borderWidth 2cantSelect falsevisible truemargins 8 htmlText1+(2+3*(4-3))+4
opaque true threeDHilite false shadowOffset 4showBorder true disabled false textSize 12fixedLineHeight true textFont ArialvScroll 0 hilitedLines showFocusBorder true cREVTable currentview (n/a) cREVGeneral scripteditorvscroll 0revUniqueID 1254399031093scripteditorselection 406 1+(2+3*(4-3))+4 EvaluationButton ewon mouseUp try put ValueOf(the text of field "ExpressionEntry") into field "ResultView" set the TextColor of field "ResultView" to "black" catch Signal put Signal into field "ResultView" set the TextColor of field "ResultView" to "red" end try end mouseUp R 3press this button to evaluate the given expression S Evaluate cREVTempMaster >traversalOn trueink srcCopythreeD trueblendLevel 0 hiliteBorder true mnemonic 0rect 215,188,297,211armFill false patterns visitedIcon 0colors 0,0,0 showIcon false showName truehilited falseshadow false sharedHilite true textAlign centerarmed falsemenuMouseButton 1id 1029altId 0labelWidth 0 accelKey armedIcon 0 textStyle lockLoc falseautoHilite truelabel EvaluateshowHilite falsevisited false disabledIcon 0style rectangle armBorder true behavior icon 0name EvaluationButtontoolTip 2press this button to evaluate the given expression accelText layer 7borderWidth 2cantSelect falsevisible true menuLines 5margins 4 accelMods opaque truedefault false shadowOffset 4text hiliteFill true menuName showBorder true disabled falsehiliteIcon 0 textSize autoArm falsefamily 0 menuMode textFont hoverIcon 0menuHistory 1showFocusBorder true cREVMaster colors 0,0,0 layer 8 cREVDivergedWin32 colors 0,0,0 128,128,128 layer 5 cREVGeneral profile Masterscripteditorvscroll 0revUniqueID 1254399262213scripteditorselection 266masterName MasterprofileList Win32 Label Field d cREVTempMaster 7 tabStops traversalOn falsefirstIndent 0ink srcCopydontSearch falsescrollbarWidth 20threeD truetoggleHilites falseblendLevel 0multipleHilites falserect 2,226,102,247textHeight 16 patterns colors shadow falsehScroll 0 textAlign leftvScrollbar falsehScrollbar falseid 1031altId 0autoTab falsehGrid false textStyle bold dontWrap truelockLoc falseautoHilite falsestyle transparentsharedText true showLines falsenoncontiguousHilites false lockText truescroll 0 behavior name Label FieldtoolTip listBehavior falsevGrid falselayer 8borderWidth 2cantSelect falsevisible truemargins 4 htmlTextResult:
opaque false threeDHilite false shadowOffset 4showBorder false disabled false textSize 12fixedLineHeight true textFont ArialvScroll 0 hilitedLines showFocusBorder true cREVTable currentview Result: cREVGeneral revUniqueID 1254399363107 Result: # ResultView )x -------------------------------------------------------------------------------- -- various handlers checking if "FileSpecEntry" is empty -- -------------------------------------------------------------------------------- command checkContents set the enabled of button "EvaluationButton" to ( \ the text of me is not empty \ ) end checkContents on CutKey send "checkContents" to me in 0 seconds end CutKey on EnterInField checkContents if (the enabled of button "EvaluationButton" is true) then send "MouseDown 1" to button "EvaluationButton" end if end EnterInField on PasteKey send "checkContents" to me in 0 seconds end PasteKey on RawKeyUp checkContents end RawKeyUp on ReturnInField checkContents if (the enabled of button "EvaluationButton" is true) then send "MouseDown 1" to button "EvaluationButton" end if end ReturnInField black P H Pwill display either the outcome of an expression evaluation or an error message cREVTempMaster 7 tabStops traversalOn truefirstIndent 0ink srcCopydontSearch falsescrollbarWidth 20threeD truetoggleHilites falseblendLevel 0multipleHilites falserect 80,222,504,294textHeight 16 patterns colors black shadow falsehScroll 0 textAlign leftvScrollbar falsehScrollbar falseid 1059altId 0autoTab falsehGrid false textStyle plain dontWrap falselockLoc falseautoHilite truestyle rectanglesharedText false showLines falsenoncontiguousHilites false lockText truescroll 0 behavior name ResultViewtoolTip Owill display either the outcome of an expression evaluation or an error message listBehavior falsevGrid falselayer 10borderWidth 2cantSelect falsevisible truemargins 8 htmlText10
opaque true threeDHilite false shadowOffset 4showBorder true disabled false textSize 12fixedLineHeight true textFont ArialvScroll 0 hilitedLines showFocusBorder true cREVTable currentview (n/a) cREVGeneral revUniqueID 1255540266730scripteditorvscroll 0scripteditorselection 406 10 WhiteOverlay.png p P PNG IHDR p P L} sRGB bKGD C pHYs tIME 4=<