2019-07-28 23:53:15 +03:00
|
|
|
// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
|
2015-06-01 22:15:17 +03:00
|
|
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
2015-12-28 14:25:15 +03:00
|
|
|
//Причина обхода узла синтаксического дерева - получение выражения, адреса, типа узла.
|
2015-05-14 22:35:07 +03:00
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace PascalABCCompiler.TreeConverter
|
|
|
|
|
{
|
2015-12-28 14:25:15 +03:00
|
|
|
//TODO: Переименовать в request.
|
2015-05-14 22:35:07 +03:00
|
|
|
/// <summary>
|
2015-12-28 14:25:15 +03:00
|
|
|
/// Будущее название класса - request.
|
2015-05-14 22:35:07 +03:00
|
|
|
/// </summary>
|
2018-11-30 23:30:21 +03:00
|
|
|
public enum motivation {none,expression_evaluation,address_receiving,semantic_node_reciving};
|
2015-05-14 22:35:07 +03:00
|
|
|
|
2015-12-28 14:25:15 +03:00
|
|
|
//TODO: Избавиться от этого.
|
2015-05-14 22:35:07 +03:00
|
|
|
public class motivation_keeper
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private motivation _mot=motivation.expression_evaluation;
|
|
|
|
|
//private bool motivation_set=false;
|
|
|
|
|
|
|
|
|
|
public void reset()
|
|
|
|
|
{
|
|
|
|
|
_mot = motivation.expression_evaluation;
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-06 15:23:20 +03:00
|
|
|
/// <summary>
|
|
|
|
|
/// синоним reset()
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void set_motivation_to_expect_expression_evaluation()
|
|
|
|
|
{
|
|
|
|
|
_mot=motivation.expression_evaluation;
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-14 22:35:07 +03:00
|
|
|
public void set_motivation_to_expect_address()
|
|
|
|
|
{
|
2018-11-30 23:30:21 +03:00
|
|
|
_mot=motivation.address_receiving;
|
2015-05-14 22:35:07 +03:00
|
|
|
}
|
|
|
|
|
|
2016-08-06 15:23:20 +03:00
|
|
|
public void set_motivation_to_expect_semantic_node()
|
2015-05-14 22:35:07 +03:00
|
|
|
{
|
|
|
|
|
_mot=motivation.semantic_node_reciving;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public motivation motivation
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2016-08-06 15:23:20 +03:00
|
|
|
return _mot;
|
2015-05-14 22:35:07 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|