Semiconductor Factory Automation Solutions

Search
  • Company
  • Products
    • HyperScript
    • XML, HTML, CGI
    • SOAP
    • SQL
    • SECS/GEM
    • PROMIS™ HS
    • TLOG Feed
    • AutoMan
    • Batch Track In
    • Equipment View
    • HTML to XHTML
  • Services
  • Support
    • Documentation
      • Language Guide
      • User's Guide
      • Installation Guide
  • Investors
  • Home

Documentation

  • Language Guide
    • Identifiers
    • Literals
    • Scope
    • Data Types
    • Declarations
    • Lists
    • Vectors
    • Structures
    • References
    • Hashed Lists
    • Statements
    • Expressions
    • Operators
    • Conditionals
    • Iteration
    • Controls
    • Methods
    • Handlers
    • Parsing
  • User's Guide
  • Installation Guide

Parsing

Using a recursive descent algorithm, HyperScript parses and executes each sub-expression as soon as the operands are known using a postfix (RPN) expression on an internal stack. The following example illustrates how HyperScript parses and executes statements and expressions. The table below has three columns: the Input column shows the token read by the HyperScript parser at each step, the Expression column shows where HyperScript adds the token prior to execution, the Stack column shows where HyperScript places the token operands, and the Action column shows when HyperScript evaluates a complete sub-expression, popping operands from the stack and pushing a result back onto the stack.

Parsing the following expression:

If ( 10 == ( 7 + 16/2 - 5 ) ) put ( "Hello" ) ;

results in the following parse operations:

Input Expression Stack Action
If if
( if (
10 if ( 10
== if ( == 10
( if ( == (
7 if ( == ( 7
+ if ( == ( + 10 7
16 if ( == ( + 16
/ if ( == ( + / 10 7 16
2 if ( == ( + / 2
- if ( == ( + - 10 7 16 2 16 / 2
5 if ( == ( + - 5 10 7 8
) if ( == ( + 10 7 8 5 8 - 5
if ( == 10 7 3 7 + 3
) if ( 10 10 (10 == 10)?
Put put
( put (
"Hello" put ( "Hello"
) "Hello"
; put("Hello")
Copyright © 2006 Abinition, Inc.