Syntax Error

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
Music2000
Posts: 26
Joined: Mon Oct 10, 2005 3:38 pm
Location: London

Syntax Error

Post by Music2000 »

I have been getting various errors with some of the examples i have found in the gallery, for example i have a file called Alveolo which gives me the error message Line 1:Parse error - syntax error, the code is -

Code: Select all

startshape START { color }

rule START {
SHAPE { b 0.7 sat 0.7 alpha -0.3}
SHAPE { r 180 b 0.7 sat 0.7 alpha -0.3}
SHAPE { r 90 b 0.7 sat 0.7 alpha -0.3}
SHAPE { r -90 b 0.7 sat 0.7 alpha -0.3}
}

rule SHAPE {
LINE { }
SHAPE { r -45 x 10 s 0.7517 alpha 0.5}
SHAPE { r 45 x 10 s 0.7517 alpha 0.5 hue -25}
}

rule SHAPE {
LINE { }
SHAPE { r -45 x 10 s 0.7517 alpha -0.5 hue 25}
SHAPE { r 45 x 10 s 0.7517 alpha -0.5}
}

rule LINE {
SQ { s 1.5 }
SQUARE { x 1 }
SQUARE { x 2 }
SQUARE { x 3 }
SQUARE { x 4 }
SQUARE { x 5 }
SQUARE { x 6 }
SQUARE { x 7 }
SQUARE { x 8 }
SQUARE { x 9 }
}

rule SQ {CIRCLE { s 1.2 alpha -0.1 }}
rule SQ {CIRCLE { s 2.2 alpha -0.3 }}
rule SQ {CIRCLE { s 1.7 alpha -0.2 }}
Im guessing that this might have something to do with the fact that color is new to the program and that the system was probably changed at some point but how would i change this code and similar examples so they work correctly in the program. Thanks :)

momo
Posts: 53
Joined: Tue Jul 19, 2005 5:08 am

Post by momo »

Yeah, as you said this code is outdated and it does not work with the last version of context free.

Anyway, in this code you only need to remove the { color } in the first line and it will work.

Music2000
Posts: 26
Joined: Mon Oct 10, 2005 3:38 pm
Location: London

Post by Music2000 »

Cool, i thought it would be harder to do, thats quite a simple thing to modify, thanks momo :)

Post Reply