/** * * OOAS Compiler - C++ AST * * Copyright 2015, AIT Austrian Institute of Technology. * All rights reserved. * * SEE THE "LICENSE" FILE FOR THE TERMS UNDER WHICH THIS FILE IS PROVIDED. * * If you modify the file please update the list of contributors below to in- * clude your name. Please also stick to the coding convention of using TABs * to do the basic (block-level) indentation and spaces for anything after * that. (Enable the display of special chars and it should be pretty obvious * what this means.) Also, remove all trailing whitespace. * * Contributors: * Willibald Krenn (AIT) * Stephan Zimmerer (AIT) * Christoph Czurda (AIT) * */ #pragma once #include #include #include #include #include #include #include #include namespace Ast { /** * Walks an Expression-Tree, ignores all the other AST elements. */ class ExpressionVisitor: public Base::TiresiasObject, public IAstVisitor { protected: CallContext* m_context; void visitSub(AstElement* subElement, AstElement* parent); void visitAstElement(AstElement* element, AstElement* parent); void error(); public: ExpressionVisitor(CallContext* context); ~ExpressionVisitor() override; void visit(TypeIdentifier* typeIdentifier) override; void visit(EnumIdentifier* enumIdentifier) override; // void visit(ValuedEnumIdentifier* enumIdentifier) override; void visit(AttributeIdentifier* attributeIdentifier) override; void visit(LocalVariableIdentifier* localVariableIdentifier) override; void visit(ParameterIdentifier* parameterIdentifier) override; void visit(ExpressionVariableIdentifier* expressionVariableIdentifier) override; void visit(MethodIdentifier* methodIdentifier) override; void visit(NamedActionIdentifier* namedActionIdentifier) override; void visit(Module* module) override; void visit(ConstantIdentifier* constantIdentifier) override; void visit(UnspecIdentifierBlock* unspecIdentifierList) override; void visit(SeqIdentifierBlock* seqIdentifierList) override; void visit(NondetIdentifierBlock* nondetIdentifierList) override; void visit(PrioIdentifierBlock* prioIdentifierList) override; void visit(MainModule* mainModule) override; void visit(IntType* intType) override; void visit(BoolType* boolType) override; void visit(EnumType* enumType) override; void visit(ListType* listType) override; void visit(TupleType* tupleType) override; void visit(NullType* nullType) override; void visit(FunctionType* functionType) override; void visit(ActionSystemType* actionSystemType) override; void visit(GuardedCommand* guardedCommand) override; void visit(Call* call) override; void visit(Assignment* assignment) override; void visit(SeqBlock* seqBlock) override; void visit(NondetBlock* nondetBlock) override; void visit(PrioBlock* prioBlock) override; void visit(Skip* skipStatement) override; void visit(Break* skipStatement) override; void visit(Abort* abortStatement) override; void visit(TernaryOperator* ternaryOperator) override; void visit(BinaryOperator* binaryOperator) override; void visit(UnaryOperator* unaryOperator) override; void visit(ExistsQuantifier* quantifier) override; void visit(ForallQuantifier* quantifier) override; void visit(ListConstructor* listConstructor) override; void visit(SetConstructor* setConstructor) override; void visit(TupleConstructor* tupleConstructor) override; void visit(ObjectConstructor* objectConstructor) override; void visit(BoolValueExpression* identifierExpression) override; void visit(IntValueExpression* identifierExpression) override; void visit(RefValueExpression* identifierExpression) override; void visit(IdentifierExpression* identifierExpression) override; void visit(TypeExpression* typeExpression) override; void visit(TupleMapAccessExpression* tupleMapAccessExpression) override; void visit(CallExpression* callExpression) override; void visit(AccessExpression* accessExpression) override; void visit(PointerType* pt) override; }; } /* namespace Ast */