 //
 //      ValueExpression ::= <NUMBER> | <STRING>
 //
-//      ReferenceExpression ::= '{' <IDENTIFIER> '}'
+//      ReferenceExpression ::= '{' <REFNAME> '}'
 //
 //      FunctionExpression ::= <IDENTIFIER> '(' FunctionParameterList ')'
 //

    private lazy var numberTokenRegularExpression = try! NSRegularExpression(pattern: "[0-9]+(\\.[0-9]+)?([eE][\\+\\-]?[0-9]+)?", options: [])
    private lazy var stringTokenRegularExpression = try! NSRegularExpression(pattern: "\"([^\"]|\"\")*\"", options: [])
    private lazy var identifierTokenRegularExpression = try! NSRegularExpression(pattern: "[A-Za-z_][A-Za-z_0-9]*", options: [])

    public init(formulitic: Formulitic, formulaString: String) {
        self.formulitic = formulitic

//      <STRING> ::= '"' ((~['"']) | ('"' '"'))* '"'
//
//      <IDENTIFIER> ::= (['A'-'Z','a'-'z','_']) (['A'-'Z','a'-'z','_','0'-'9'])*
//
//      <REFNAME> ::= (~['}'])+


class FormulaParser {
