Dangling Else Ambiguity
1
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()
}
2
Name:
Anonymous
2007-12-09 11:39
Is that Haskell?
3
Name:
Anonymous
2007-12-09 11:41
No /prog/, not everything is Haskell.
Im using Javacc
4
Name:
Anonymous
2007-12-09 11:47
5
Name:
Anonymous
2007-12-09 11:48
JAVAPPLES!?!
6
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
7
Name:
Anonymous
2007-12-09 12:03
Is /prog/ not a BAD ENOUGH DUDE to SOVLE THE PRESIDENT?
8
Name:
Anonymous
2007-12-09 12:08
Fuck you, this thread is now about Haskell nomads.
9
Name:
Anonymous
2007-12-09 12:09
Fuck Haskell, there, I said it.
10
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
11
Name:
Anonymous
2007-12-09 12:21
>>10
ahaha good job, my brother in Haskell.
12
Name:
Anonymous
2007-12-09 12:46
haskell programmers have no brothers, just their own torn broken souls
13
Name:
Anonymous
2007-12-09 13:01
Op here, thanks for helping.
Any COBOL programmers around?
I used to COBOL for the government. Supafly.
14
Name:
Anonymous
2007-12-09 13:13
>>12
Have you
SEEN our vibrant community at
http://haskell.org ?
15
Name:
Anonymous
2007-12-09 13:16
>>14
Is that some kind of haskellFag concentration camp?
16
Name:
Anonymous
2007-12-09 13:17
>>13
COBOL has no nomads D;
17
Name:
Anonymous
2007-12-09 13:19
>>15
I invented the shitCase haskellFag, I'm glad you use my invention.
18
Name:
Anonymous
2007-12-09 13:20
>>17
Disregard that, I curry cocks.
19
Name:
Anonymous
2007-12-09 13:36
>>18
You wanna cdr down my penis, baby?
20
Name:
Anonymous
2007-12-09 14:23
>>1 TOM? RICHARD? PAUL?
Read SICP. Compiler Construction assignment is easy.
21
Name:
Anonymous
2007-12-09 14:25
22
Name:
Anonymous
2007-12-09 18:19
23
Name:
Anonymous
2007-12-09 18:53
24
Name:
Anonymous
2007-12-10 0:45
>>23
outdated crap, absolute nonsense in the context of today.
25
Name:
Anonymous
2007-12-10 1:39
>>24
2005 is outdated? Can you provide some texts to more relevant material then?
26
Name:
Anonymous
2007-12-10 5:00
27
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()
}
28
Name:
Anonymous
2007-12-10 11:03
>>27
Nice Haskell you got there!
29
Name:
Anonymous
2007-12-10 11:07
30
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
31
Name:
Anonymous
2007-12-10 11:29
32
Name:
Anonymous
2007-12-10 12:40
lol Dangling
33
Name:
Anonymous
2007-12-10 18:00
>>27
omg LL1 and easier to read
void IfStmt() : {} {
<IF> Expr() <THEN> Stmt() [LOOKAHEAD(1) <ELSE> Stmt()]
}
34
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.
35
Name:
Anonymous
2007-12-10 18:37
>>34
and fuck you, BBCode:
(iftest-form then-form[else-form])
36
Name:
Anonymous
2009-03-18 2:31
I'm feeling really keen, for some of that good ol' green
Marijuana MUST be legalized.
37
Name:
Anonymous
2011-02-04 17:19
38
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