Operator-precedence parser: Difference between revisions

Content deleted Content added
Add C# implementation to "Tutorials and implementations" section
Line 128:
#include <string.h>
 
// The command-line argument boundary is our lexer.
int main(int argc, char *argv[]) {
int i;
printf("((((");
for (i=1; i!=argc; i++) {
// strlen(argv[i]) == 2
if (argv[i] && !argv[i][1]) {
switch (*argv[i]) {
Line 140 ⟶ 142:
case '/': printf("))/(("); continue;
case '+':
// unary lookback
if (i == 1 || strchr("(^*/+-", *argv[i-1]))
printf("+");