3 ms·
Probably true, but only because the implementation language for them is also C. Some of them also frequently use a mix of the implementation language and gramma
by lifthrasiir 10y ago
Probably true, but only because the implementation language for them is also C. Some of them also frequently use a mix of the implementation language and grammar specification DSL like yacc.
- sebcat 10y agoUse of DSLs and tools like flex and bison makes the implementation a whole lot more reliable (but only if they're used, and some commonly run languages have a very implementation-specific grammar). consider: input: /* empty string */ | input line ; line: '\n' | exp '\n' { printf ("\t%.10g\n", $1); } ; exp: NUM { $$ = $1; } | exp '+' exp { $$ = $1 + $3; } | exp '-' exp { $$ = $1 - $3; } | exp '*' exp { $$ = $1 * $3; } | exp '/' exp { $$ = $1 / $3; } | '-' exp %prec NEG { $$ = -$2; } | exp '^' exp { $$ = pow ($1, $3); } | '(' exp ')' { $$ = $2; } ; http://dinosaur.compilertools.net/bison/bison_5.html#SEC27 http://dinosaur.compilertools.net/bison/bison_5.html#SEC27