Ignore:
Timestamp:
Aug 13, 2019, 2:03:37 PM (5 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
1118b8b
Parents:
7d01cf44
Message:

Most expressions now return a hard-coded lvalue flag.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    r7d01cf44 r14388c1  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Aug  7 17:03:00 2019
    13 // Update Count     : 62
     12// Last Modified On : Tue Aug 13 11:31:00 2019
     13// Update Count     : 63
    1414//
    1515
     
    6464
    6565bool Expression::get_lvalue() const {
    66         return result->get_lvalue();
     66        assert( !result->get_lvalue() );
     67        return false;
    6768}
    6869
     
    138139}
    139140
     141bool VariableExpr::get_lvalue() const {
     142        return result->get_lvalue();
     143}
     144
    140145VariableExpr * VariableExpr::functionPointer( FunctionDecl * func ) {
    141146        VariableExpr * funcExpr = new VariableExpr( func );
     
    269274CastExpr::~CastExpr() {
    270275        delete arg;
     276}
     277
     278bool CastExpr::get_lvalue() const {
     279        return result->get_lvalue();
    271280}
    272281
     
    380389        // don't delete the member declaration, since it points somewhere else in the tree
    381390        delete aggregate;
     391}
     392
     393bool MemberExpr::get_lvalue() const {
     394        assert( result->get_lvalue() );
     395        return true;
    382396}
    383397
     
    432446}
    433447
     448bool UntypedExpr::get_lvalue() const {
     449        return result->get_lvalue();
     450}
    434451
    435452void UntypedExpr::print( std::ostream & os, Indenter indent ) const {
     
    490507        delete arg2;
    491508        delete arg3;
     509}
     510
     511bool ConditionalExpr::get_lvalue() const {
     512        return result->get_lvalue();
    492513}
    493514
     
    548569}
    549570
     571bool ConstructorExpr::get_lvalue() const {
     572        return result->get_lvalue();
     573}
     574
    550575void ConstructorExpr::print( std::ostream & os, Indenter indent ) const {
    551576        os <<  "Constructor Expression: " << std::endl << indent+1;
     
    565590CompoundLiteralExpr::~CompoundLiteralExpr() {
    566591        delete initializer;
     592}
     593
     594bool CompoundLiteralExpr::get_lvalue() const {
     595        assert( result->get_lvalue() );
     596        return true;
    567597}
    568598
Note: See TracChangeset for help on using the changeset viewer.