本文整理汇总了C#中PascalABCCompiler.SyntaxTree.SourceContext类的典型用法代码示例。如果您正苦于以下问题:C# SourceContext类的具体用法?C# SourceContext怎么用?C# SourceContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SourceContext类属于PascalABCCompiler.SyntaxTree命名空间,在下文中一共展示了SourceContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTokenSourceContext
public override SourceContext GetTokenSourceContext(Parser parser)
{
int LineNum = parser.TokenLineNumber + LineCorrection;
SourceContext sc = new SourceContext(LineNum, parser.TokenLinePosition, LineNum + GetLinesCount(parser.TokenText), parser.TokenLinePosition + parser.TokenLength - 1, parser.TokenCharPosition, parser.TokenCharPosition + parser.TokenLength);
if (scm != null)
sc = scm.GetSourceContext(sc);
return sc;
}
示例2: Find
public syntax_tree_node Find(SyntaxTree.compilation_unit unit, SourceContext findContext)
{
_findContext = findContext;
_findResult = null;
//unit.visit(this);
ProcessNode(unit);
return _findResult;
}
示例3: In
public bool In(SourceContext sc)
{
//return Position >= sc.Position && (Length + Position <= sc.Length + sc.Position);
return
!((begin_position.line_num < sc.begin_position.line_num) ||
(end_position.line_num > sc.end_position.line_num) ||
(begin_position.line_num == sc.begin_position.line_num && begin_position.column_num < sc.begin_position.column_num) ||
(end_position.line_num == sc.end_position.line_num && end_position.column_num > sc.end_position.column_num));
}
示例4: Merge
public SourceContext Merge(SourceContext right)
{
return new SourceContext(this, right);
}
示例5: SCToLexLoc
public LexLocation SCToLexLoc(SourceContext sc) // переопределить неявное преобразование типов?
{
return new LexLocation(sc.begin_position.line_num, sc.begin_position.column_num - 1, sc.end_position.line_num, sc.end_position.column_num, sc.FileName);
}
示例6: BuildShortFuncDefinition
public static procedure_definition BuildShortFuncDefinition(formal_parameters fp, procedure_attributes_list att, method_name name, type_definition result, expression ex, SourceContext headsc)
{
var ff = new function_header(fp, att, name, null, result, headsc);
procedure_definition pd = BuildShortProcFuncDefinition(ff, new assign("Result", ex, ex.source_context));
return pd;
}
示例7: property_accessors
///<summary>
///Конструктор с параметрами.
///</summary>
public property_accessors(read_accessor_name _read_accessor,write_accessor_name _write_accessor,SourceContext sc)
{
this._read_accessor=_read_accessor;
this._write_accessor=_write_accessor;
source_context = sc;
}
示例8: array_const
///<summary>
///Конструктор с параметрами.
///</summary>
public array_const(expression_list _elements,SourceContext sc)
{
this._elements=_elements;
source_context = sc;
}
示例9: case_node
///<summary>
///Конструктор с параметрами.
///</summary>
public case_node(expression _param,case_variants _conditions,statement _else_statement,SourceContext sc)
{
this._param=_param;
this._conditions=_conditions;
this._else_statement=_else_statement;
source_context = sc;
}
示例10: case_variant
///<summary>
///Конструктор с параметрами.
///</summary>
public case_variant(expression_list _conditions,statement _exec_if_true,SourceContext sc)
{
this._conditions=_conditions;
this._exec_if_true=_exec_if_true;
source_context = sc;
}
示例11: get_address
///<summary>
///Конструктор с параметрами.
///</summary>
public get_address(addressed_value _address_of,SourceContext sc)
{
this._address_of=_address_of;
source_context = sc;
}
示例12: hex_constant
///<summary>
///Конструктор с параметрами.
///</summary>
public hex_constant(Int64 _val,SourceContext sc)
{
this._val=_val;
source_context = sc;
}
示例13: program_module
///<summary>
///Конструктор с параметрами.
///</summary>
public program_module(string _file_name,List<compiler_directive> _compiler_directives,LanguageId _Language,program_name _program_name,uses_list _used_units,block _program_block,using_list _using_namespaces,SourceContext sc)
{
this._file_name=_file_name;
this._compiler_directives=_compiler_directives;
this._Language=_Language;
this._program_name=_program_name;
this._used_units=_used_units;
this._program_block=_program_block;
this._using_namespaces=_using_namespaces;
source_context = sc;
}
示例14: unit_module
///<summary>
///Конструктор с параметрами.
///</summary>
public unit_module(string _file_name,List<compiler_directive> _compiler_directives,LanguageId _Language,unit_name _unit_name,interface_node _interface_part,implementation_node _implementation_part,statement_list _initialization_part,statement_list _finalization_part,attribute_list _attributes,SourceContext sc)
{
this._file_name=_file_name;
this._compiler_directives=_compiler_directives;
this._Language=_Language;
this._unit_name=_unit_name;
this._interface_part=_interface_part;
this._implementation_part=_implementation_part;
this._initialization_part=_initialization_part;
this._finalization_part=_finalization_part;
this._attributes=_attributes;
source_context = sc;
}
示例15: method_call
///<summary>
///Конструктор с параметрами.
///</summary>
public method_call(addressed_value _dereferencing_value,expression_list _parameters,SourceContext sc)
{
this._dereferencing_value=_dereferencing_value;
this._parameters=_parameters;
source_context = sc;
}