Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > polish stack

Thread Tools

polish stack

Stefan Ram
Posts: n/a
"Mr. X." <> writes:
>there are two stacks :

For this approach (I do not know whether this is the same as a
»polish stack«), you might read the paragraph starting with

»I gave each symbol in the syntax table a particular code«


. Also see the English text at the end of Removed)

. The classical reference is

Sequential Formula Translation
K. Samelson and F. L. Bauer
Communications of the ACM
Volume 3, Issue 2 (February 1960)
Pages: 76 - 83

. I have implemented such a stack pair once in Java.
The support code is rather large and unpublished yet.
But the two core methods for the stack pair are given below.

public static void acceptOperator
( final OperatorToken operatorToken,
final de.dclj.ram.notation.bauer.notation.PlacementHint placementHint,
final OperatorStack operatorStack,
final DesignationStack designationStack )
{ int rightPriority;
if( placementHint instanceof OperatorMustBePrefixPlacementHint )
{ rightPriority = getOperatorRightPriorityInPrefixContext( operatorToken ); }
{ rightPriority = getOperatorRightPriorityInInfixContext( operatorToken ); }
while( isReducible( operatorStack, rightPriority ))
{ OperatorToken operator = operatorStack.pop();
operator.reduce( placementHint, operatorStack, designationStack ); }
operatorStack.accept( operatorToken ); }

public static void acceptLiteral
( final LiteralToken literalToken,
final de.dclj.ram.notation.bauer.notation.PlacementHint placementHint,
final OperatorStack operatorStack,
final DesignationStack designationStack )
{ designationStack.accept( literalToken.value() ); }}

Reply With Quote
Arne Vajhøj
Posts: n/a
Mr. X. wrote:
> I don't have book of polish-stack, and I won't buy any,

Do you want to get through life asking people to spend
time explaining thing sin detail for you instead of
you actually sit down, read the relevant books and learn something ?

> If you don't want to answer - please, don't answer at all.

That is our decision.

> I just want to know the concept in details !

Study !

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does std::stack::pop() not throw an exception if the stack is empty? Debajit Adhikary C++ 36 02-10-2011 08:54 PM
C/C++ compilers have one stack for local variables and return addresses and then another stack for array allocations on the stack. Casey Hawthorne C Programming 3 11-01-2009 08:23 PM
stack frame size on linux/solaris of a running application stack Surinder Singh C Programming 1 12-20-2007 01:16 PM
Why stack overflow with such a small stack? Kenneth McDonald Ruby 7 09-01-2007 04:21 AM
"stack level too deep"... because Threads keep their "starting" stack Sam Roberts Ruby 1 02-11-2005 04:25 AM