xzhang 0 Newbie Poster

Can anyone help me ?
The question is :
Write a function to parse a list (sequence) of symbols

Determine if the sequence is valid by the following grammar:

PROP ::= ATOM | PROP UNIOP | PROP PROP BINOP
ATOM ::= 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
UNIOP ::= 'not'
BINOP ::= 'and' | 'or' | 'if' | 'iff'

Return the value "valid" or "in-valid" as the case may be from the function (parse stack string)

There are have some coded functions and uncoded functions, help me figure out the uncoded functions.

(define (isAtom? sym) )
(define (binOp? sym))
(define (uniOp? sym))
(define (checkEnding stack))
(define (lexer inpt))
(define (reduce stack); just let stack errors bomb!
#f))

(define (parse stack inpt)
(cond ((null? stack) (write stack)(write inpt)(parse (cons (lexer inpt) stack) (cdr inpt)))
((eq? (car stack) 'ATOM) (write stack)(write inpt)(parse (reduce stack) inpt))
((eq? (car stack) 'BINOP) (write stack)(write inpt)(parse (reduce stack) inpt))
((eq? (car stack) 'UNIOP) (write stack)(write inpt)(write "\n")(parse (reduce stack) inpt))
((null? inpt)(write stack)(write inpt)(write "\n")(checkEnding stack))
(else (write stack)(write inpt)(write "\n")(parse (cons (lexer inpt) stack) (cdr inpt))))) ; notice the restriction here!