Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Dangling Else Ambiguity

Name: OMG LEFT RECURSION111!! 2007-12-09 11:36

Halp /prog/, I want to solve the Dangling Else Ambiguity here but I keep screwing it up.

void IfStmt() : {}
{
        <IF> Expr() <THEN> Stmt()
    |    <IF> Expr() <THEN> Stmt() <ELSE> Stmt()
}

void Stmt() : {}
{
        Assignment()
    |    IfStmt()
    |    WhileStmt()
    |    CaseStmt()
    |    Function()
    |    IOStmt()
    |    Block()
    |    Return()
}

Name: Anonymous 2007-12-09 11:39

Is that Haskell?

Name: Anonymous 2007-12-09 11:41

No /prog/, not everything is Haskell.

Im using Javacc

Name: Anonymous 2007-12-09 11:47

>>3
Is that Haskell?

Name: Anonymous 2007-12-09 11:48

JAVAPPLES!?!

Name: Anonymous 2007-12-09 11:59

Its not Haskell.

Its java compiler compiler compiler compiler compiler compiler compiler compiler compiler compiler compiler compiler compiler

Name: Anonymous 2007-12-09 12:03

Is /prog/ not a BAD ENOUGH DUDE to SOVLE THE PRESIDENT?

Name: Anonymous 2007-12-09 12:08

Fuck you, this thread is now about Haskell nomads.

Name: Anonymous 2007-12-09 12:09

Fuck Haskell, there, I said it.

Name: Anonymous 2007-12-09 12:15

data Aexp = Number Float | Plus Aexp Aexp | Minus Aexp Aexp | Times Aexp Aexp
evaluate :: Aexp -> Float
evaluate (Number x)  = x
evaluate (Plus x y)  = evaluate (x) + evaluate (y)
evaluate (Minus x y) = evaluate (x) - evaluate (y)
evaluate (Times x y) = evaluate (x) * evaluate(y)


you bitches dont know about my haskell

Name: Anonymous 2007-12-09 12:21

>>10
ahaha good job, my brother in Haskell.

Name: Anonymous 2007-12-09 12:46

haskell programmers have no brothers, just their own torn broken souls

Name: Anonymous 2007-12-09 13:01

Op here, thanks for helping.

Any COBOL programmers around?

I used to COBOL for the government. Supafly.

Name: Anonymous 2007-12-09 13:13

>>12
Have you SEEN our vibrant community at http://haskell.org?

Name: Anonymous 2007-12-09 13:16

>>14
Is that some kind of haskellFag concentration camp?

Name: Anonymous 2007-12-09 13:17

>>13
COBOL has no nomads D;

Name: Anonymous 2007-12-09 13:19

>>15
I invented the shitCase haskellFag, I'm glad you use my invention.

Name: Anonymous 2007-12-09 13:20

>>17
Disregard that, I curry cocks.

Name: Anonymous 2007-12-09 13:36

>>18
You wanna cdr down my penis, baby?

Name: Anonymous 2007-12-09 14:23

>>1 TOM? RICHARD? PAUL?
Read SICP. Compiler Construction assignment is easy.

Name: Anonymous 2007-12-09 14:25

>>20

Shut up Geoff.

Name: Anonymous 2007-12-09 18:19

>>21 lol

Name: Anonymous 2007-12-09 18:53

Book on Compiler Construction theory
http://www.oberon.ethz.ch/WirthPubl/CBEAll.pdf

Name: Anonymous 2007-12-10 0:45

>>23
outdated crap, absolute nonsense in the context of today.

Name: Anonymous 2007-12-10 1:39

>>24
2005 is outdated? Can you provide some texts to more relevant material then?

Name: Anonymous 2007-12-10 5:00

Name: Anonymous 2007-12-10 9:46

void IfStmt() : {}
{
        <IF> Expr() <THEN> Stmt()
    |    <IF> Expr() <THEN> StmtExceptIf() <ELSE> Stmt()
}

void Stmt() : {}
{ StmtExceptIf() | IfStmt() }

void StmtExceptIf() : {}
{
        Assignment()
    |    WhileStmt()
    |    CaseStmt()
    |    Function()
    |    IOStmt()
    |    Block()
    |    Return()
}

Name: Anonymous 2007-12-10 11:03

>>27
Nice Haskell you got there!

Name: Anonymous 2007-12-10 11:07

>>28
fuck off right now

Name: Anonymous 2007-12-10 11:12

>>29 is an enterprise suit that can't have fun with programming;
>>30 is a guy who kones Haskell, Lisp and C (because Haskell and Lisp will never get me a job);
>>31 is a toy language smug weenine that will never have a job

Name: Anonymous 2007-12-10 11:29

>>30 is a little slow.

Name: Anonymous 2007-12-10 12:40

lol Dangling

Name: Anonymous 2007-12-10 18:00

>>27

omg LL1 and easier to read

void IfStmt() : {} {
     <IF> Expr() <THEN> Stmt() [LOOKAHEAD(1) <ELSE> Stmt()]
}

Name: Anonymous 2007-12-10 18:35

(if [i]test-form[/i] [i]then-form[/i] [[i]else-form[/i]])

lrn2not have a fucking ambiguous grammar.

Name: Anonymous 2007-12-10 18:37

>>34
and fuck you, BBCode:

(iftest-form then-form[else-form])

Name: Anonymous 2009-03-18 2:31

I'm feeling really keen, for some of that good ol' green

Marijuana MUST be legalized.

Name: Anonymous 2011-02-04 17:19

Name: Anonymous 2013-01-18 22:59

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List