Talk:Stack-oriented programming: Difference between revisions

Content deleted Content added
Tags: Mobile edit Mobile app edit
Tags: Mobile edit Mobile app edit
Line 17:
It also excludes lenguages that do not have parameter. For example a language of functions that operate on a character stream (or string) and manipulates stacks directly.
 
[[TREE-META]] is one example. CWIC another. They are metacompilers. The syntax language is syntax equationequations, boolean functions. Each euation expresses a goal, recognizing some language structure. They are boolean equations that analyze an input character stream and return success(true) or failure(false). Using operates like ''''':'''<node>'' that creates a node and pushes it onto the node stack and '''''!'''<number>'' that creates a tree, taking the top node stack entry and the top ''<number>'' of parse stack entries putting them to gather to form a tree that is pushed on that parse stack. The +[ ... ]+ make a list of parse stack entries pushed between them.
 
A set of syntax functions that parse an arithmetic expression building a abstract syntax tree on the parse atack:
Line 43:
</pre>
The syntax equations described are from the CWIC syntax language only using the Kleenex star '''*''' instead of the CWIC zero or more $ operator. expr using $ operatot:
expr = term $(('+':ADD|'-':SUB) term!2)*;
 
The id and num '''..''' equation are token making euations. id catalogs the parsed characters in the dictionary creating a symbol object that is pushed in the parse stack. The num equation recognizes sequence of one or more dgt. MAKENUM() is a function call that intercepts the dictionary processing. It creates a numeric object from the dgt sequence and pushes it or the parse stack.