Skip to content

Instantly share code, notes, and snippets.

@hectorj
Created May 17, 2015 04:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hectorj/bbbfd6a3be6e2d72ed04 to your computer and use it in GitHub Desktop.
Save hectorj/bbbfd6a3be6e2d72ed04 to your computer and use it in GitHub Desktop.
Attempt at defining the ESI expressions' grammar
Expression = Value {{" "} Operator {" "} Value}.
Operator = Comparison_operator | Logical_operator .
Comparison_operator = "==" | "!=" | "<" | ">" | "<=" | ">=".
Logical_operator = "!" | "&" | "|".
Variable = "$(" (Simple_variable | Substructure) ")".
Simple_variable = "HTTP_HOST" | "HTTP_REFERER".
Substructure = ("HTTP_ACCEPT_LANGUAGE" | "HTTP_COOKIE" | "HTTP_USER_AGENT" | "QUERY_STRING") "{" word "}".
word = .
Value = (Expression | Variable | string | int | float).
string = .
int = .
float = .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment