Author:admin

Date:2008-09-25T16:19:15.000000Z


git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@44 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
jfiat
2008-09-25 16:19:15 +00:00
parent 7d4e6a18b3
commit 2780526eae
234 changed files with 374 additions and 382 deletions

View File

@@ -3,7 +3,10 @@
[[Property:uuid|12c3409d-165b-b1df-e26a-b05d49969661]]
This sample consists of a command line reverse Polish notation (RPN) calculator.
{{note| '''Note:''' A RPN calculator works slightly differently from standard calculators. It consists of a stack of numbers. Operations are applied to the two numbers on top of the stack. The result is then put on top of the stack so that it can be used in the next operation. This sample refers to the top of the stack as ''Accumulator''.
{{note|A RPN calculator works slightly differently from standard calculators. It consists of a stack of numbers. Operations are applied to the two numbers on top of the stack. The result is then put on top of the stack so that it can be used in the next operation. This sample refers to the top of the stack as ''Accumulator''.This sample consists of a command line reverse Polish notation (RPN) calculator. }}
{{note|A RPN calculator works slightly differently from standard calculators. It consists of a stack of numbers. Operations are applied to the two numbers on top of the stack. The result is then put on top of the stack so that it can be used in the next operation. This sample refers to the top of the stack as ''Accumulator''. }}
==Compiling==
To compile the example:
@@ -36,7 +39,7 @@ Enter a number, followed by :
Enter the first number to be put onto the stack, for example <code>3</code>.
{{note| '''Note:''' Failing to enter a number at this stage will cause the sample to stop. This sample was designed to showcase the use of EiffelBase data structures and is not protected against unexpected entries. }}
{{note|Failing to enter a number at this stage will cause the sample to stop. This sample was designed to showcase the use of EiffelBase data structures and is not protected against unexpected entries. }}
You may then add another number on the stack by entering the character <code>a</code>:
<code>
@@ -77,7 +80,7 @@ Next operation?
You may use the operation <code>0</code> to clear the stack at any time. You may use <code>q</code> to quit the program.
{{tip| '''Tip:''' You can use the command <code>?</code> to display the list of available operations. }}
{{tip|You can use the command <code>?</code> to display the list of available operations. }}
==Under the Hood==
@@ -94,7 +97,7 @@ Each of these classes implement the feature do_one_state from STATE which perfor
Every descendant of STATE implement the feature operation which performs the corresponding stack transformation.
See the reference for the class interfaces.
}}