ReferenceAccess id_accessP(ReferenceAccess record, ReferenceAccess member) { if (peek(".")) { match("."); ReferenceAccess reference = direct_variable_declaratorExpr(); ReferenceAccess refAcc = id_accessP(member, reference); return new MiembroRegistro(record.lexeme, refAcc); } else return new MiembroRegistro(record.lexeme, member); }
ReferenceAccess postId_expr(ReferenceAccess id) { switch (currentToken.Tipo) { case TokenType.LEFT_SQUARE_BRACKET: List<Expr> indexList = new List<Expr>(); variable_arrayExpr(indexList); IndiceArreglo indicearreglo = new IndiceArreglo(indexList, id.lexeme); return indicearreglo; case TokenType.LEFT_PARENTHESIS: List <Expr> parameterList = function_call(); LlamadaFuncion llamadafuncion = new LlamadaFuncion(id.lexeme, parameterList); return llamadafuncion; case TokenType.DOT: //List<ReferenceAccess> membersList = new List<ReferenceAccess>(); MiembroRegistro miembroRegistro = (MiembroRegistro)id_access(id); return miembroRegistro; //MiembroRegistro miembroRegistro = new MiembroRegistro(id.lexeme, membersList); //return miembroRegistro; default: throw new Exception("Error en la expresion postId linea: " + Lexer.line + " columna: " + Lexer.column + " currenttoken -> " + currentToken.Lexema); } }
//void id_access(List<ReferenceAccess> memberslist) ReferenceAccess id_access(ReferenceAccess id) { match("."); ReferenceAccess reference = direct_variable_declaratorExpr(); return id_accessP(id,reference); }
public MiembroRegistro(string lex, ReferenceAccess mem) : base(lex) { member = mem; }