polish stack

S

Stefan Ram

Mr. X. said:
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«

at

http://www.woz.org/letters/general/03.html

. Also see the English text at the end of

http://groups.google.com/[email protected]

. 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
ISSN:0001-0782

. 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 ); }
else
{ 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() ); }}
 
A

Arne Vajhøj

Mr. X. said:
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 !

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top