private Expr parseLogicalExpression(EnclosingScope scope, boolean terminated) {
		checkNotEof();
		int start = index;
		Expr lhs = parseAndOrExpression(scope, terminated);
		Token lookahead = tryAndMatch(terminated, LogicalImplication, LogicalIff);
		if (lookahead != null) {
			switch (lookahead.kind) {
			case LogicalImplication: {
				Expr rhs = parseExpression(scope, terminated);
				lhs = new Expr.LogicalImplication(lhs, rhs);
				break;
			}
			case LogicalIff: {
				Expr rhs = parseExpression(scope, terminated);
				lhs = new Expr.LogicalIff(lhs, rhs);
				break;
			}
			default:
				throw new RuntimeException("deadcode"); // dead-code
			}
			lhs = annotateSourceLocation(lhs,start);
		}
		return lhs;
	}
private Expr parseLogicalExpression ( EnclosingScope scope , boolean terminated ) { checkNotEof ( ) ; int start = index ; Expr lhs = parseAndOrExpression ( scope , terminated ) ; Token lookahead = tryAndMatch ( terminated , LogicalImplication , LogicalIff ) ; if ( lookahead != null ) { switch ( lookahead . kind ) { case LogicalImplication : { Expr rhs = parseExpression ( scope , terminated ) ; lhs = new Expr . LogicalImplication ( lhs , rhs ) ; break ; } case LogicalIff : { Expr rhs = parseExpression ( scope , terminated ) ; lhs = new Expr . LogicalIff ( lhs , rhs ) ; break ; } default : throw new RuntimeException ( "deadcode" ) ; } lhs = annotateSourceLocation ( lhs , start ) ; } return lhs ; }
Parse a logical expression of the form:

<pre>
Expr ::= AndOrExpr [ "==>" UnitExpr]
</pre>

@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param terminated
This indicates that the expression is known to be terminated
(or not). An expression that's known to be terminated is one
which is guaranteed to be followed by something. This is
important because it means that we can ignore any newline
characters encountered in parsing this expression, and that
we'll never overrun the end of the expression (i.e. because
there's guaranteed to be something which terminates this
expression). A classic situation where terminated is true is
when parsing an expression surrounded in braces. In such case,
we know the right-brace will always terminate this expression.

@return