pascalabcnet/TreeConverter/TreeConversion/motivation.cs

54 lines
1.4 KiB
C#
Raw Permalink Normal View History

2015-06-01 22:15:17 +03:00
// Copyright (c) Ivan Bondarev, Stanislav Mihalkovich (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
//Причина обхода узла синтаксического дерева - получение выражения, адреса, типа узла.
2015-05-14 22:35:07 +03:00
using System;
namespace PascalABCCompiler.TreeConverter
{
//TODO: Переименовать в request.
2015-05-14 22:35:07 +03:00
/// <summary>
/// Будущее название класса - 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
//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
}
}
}
}