• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# LexLocation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中LexLocation的典型用法代码示例。如果您正苦于以下问题:C# LexLocation类的具体用法?C# LexLocation怎么用?C# LexLocation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LexLocation类属于命名空间,在下文中一共展示了LexLocation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: NewUnitHeading

        public unit_name NewUnitHeading(ident unitkeyword, ident uname, LexLocation loc)
        {
            var un = new unit_name(uname, UnitHeaderKeyword.Unit, loc);
            if (unitkeyword.name.ToLower().Equals("library"))
				un.HeaderKeyword = UnitHeaderKeyword.Library;
            return un;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:7,代码来源:SemanticRules.cs


示例2: create_int_const

 public virtual const_node create_int_const(string text,LexLocation loc,System.Globalization.NumberStyles NumberStyles)
 {
     if (NumberStyles == System.Globalization.NumberStyles.HexNumber)
         text = text.Substring(1);
     const_node cn = new int32_const();
     if (text.Length < 8)
         (cn as int32_const).val = Int32.Parse(text,System.Globalization.NumberStyles.Integer);
     else
     {
         try
         {
             UInt64 uint64 = UInt64.Parse(text,System.Globalization.NumberStyles.Integer);
             if (uint64 <= Int32.MaxValue)
                 (cn as int32_const).val = (Int32)uint64;
             else
                 if (uint64 <= Int64.MaxValue)
                     cn = new int64_const((Int64)uint64);
                 else
                     cn = new uint64_const(uint64);
         }
         catch (Exception)
         {
             if (NumberStyles == System.Globalization.NumberStyles.HexNumber)
                 GPPGParser.errors.Add(new BadHex(GPPGParser.current_file_name,GetTokenSourceContext(loc),new syntax_tree_node()));
             else
                 GPPGParser.errors.Add(new BadInt(GPPGParser.current_file_name,GetTokenSourceContext(loc),new syntax_tree_node()));
         }
     }
     cn.source_context = GetTokenSourceContext(loc);
     return cn;
 }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:31,代码来源:GPPGTools.cs


示例3: NewAsIsConstexpr

        public typecast_node NewAsIsConstexpr(expression constterm, op_typecast typecastop, type_definition tdef, LexLocation loc)
        {
            var naic = new typecast_node(constterm as addressed_value, tdef, typecastop, loc); 
			if (!(constterm is addressed_value))
                parsertools.errors.Add(new bad_operand_type(parsertools.CurrentFileName, constterm.source_context, naic));
            return naic;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:7,代码来源:SemanticRules.cs


示例4: NewProcedureHeader

        public procedure_header NewProcedureHeader(attribute_list attrlist, procedure_header nprh, procedure_attribute forw, LexLocation loc)
        {
            if (nprh.proc_attributes == null) 
				nprh.proc_attributes = new procedure_attributes_list();
            nprh.proc_attributes.Add(forw, forw.source_context); 
			nprh.attributes = attrlist;
			nprh.source_context = loc;
            return nprh;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:9,代码来源:SemanticRules.cs


示例5: NewConstVariable

        public expression NewConstVariable(expression constvariable, expression constvariable2, LexLocation loc)
        {
            if (constvariable2 is dereference) 
				((dereference)constvariable2).dereferencing_value = (addressed_value)constvariable;
			if (constvariable2 is dot_node) 
				((dot_node)constvariable2).left = (addressed_value)constvariable;
			var ncv = constvariable2;
            ncv.source_context = loc;
            return ncv;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:10,代码来源:SemanticRules.cs


示例6: WriteError

 public static void WriteError(string Message, LexLocation Location, string Param = "")
 {
     string res;
     if (Param == "")
         res = Message;
     else
         res = string.Format(Message, Param);
     Console.ForegroundColor = ConsoleColor.Red;
     Console.WriteLine("("+ Location.StartLine+","+Location.StartColumn+") " + res);
     Console.ResetColor();
     ErrorCount += 1;
 }
开发者ID:MikhailoMMX,项目名称:AspectMarkup,代码行数:12,代码来源:ErrorReporter.cs


示例7: NewProgramModule

        public program_module NewProgramModule(program_name progName, Object optHeadCompDirs, uses_list mainUsesClose, syntax_tree_node progBlock, Object optPoint, LexLocation loc)
        {
            var progModule = new program_module(progName, mainUsesClose, progBlock as block, null, loc);
            progModule.Language = LanguageId.PascalABCNET;
            if (optPoint == null && progBlock != null)
            {
                var fp = progBlock.source_context.end_position;
                var err_stn = progBlock;
			    if ((progBlock is block) && (progBlock as block).program_code != null && (progBlock as block).program_code.subnodes != null && (progBlock as block).program_code.subnodes.Count > 0)
                    err_stn = (progBlock as block).program_code.subnodes[(progBlock as block).program_code.subnodes.Count - 1];
                parsertools.errors.Add(new PABCNETUnexpectedToken(parsertools.CurrentFileName, StringResources.Get("TKPOINT"), new SourceContext(fp.line_num, fp.column_num + 1, fp.line_num, fp.column_num + 1, 0, 0), err_stn));
            }
            return progModule;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:14,代码来源:SemanticRules.cs


示例8: MakeDirective

        public static compiler_directive MakeDirective(string text, LexLocation loc)
        {
            string name = "";
            string directive = "";

            if (text != null)
            {
                var ind = text.IndexOf(' ');
                if (ind == -1)
                    name = text;
                else
                {
                    name = text.Substring(0, ind);
                    directive = text.Substring(ind+1);
                    if (directive.StartsWith("'"))
                        directive = directive.Remove(0,1);
                    if (directive.EndsWith("'"))
                        directive = directive.Substring(0, directive.Length - 1);
                }
            }

            return new compiler_directive(new token_info(name), new token_info(directive), loc);
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:23,代码来源:PreprocessorTools.cs


示例9: NewLambdaBody

        public statement_list NewLambdaBody(expression expr_l1, LexLocation loc)
        {
            var _statement_list = new statement_list();
			var id = new ident("result");
			var _op_type_node = new op_type_node(Operators.Assignment);
			//_op_type_node.source_context = parsertools.GetTokenSourceContext();
			var _assign = new assign((addressed_value)id, expr_l1, _op_type_node.type);
			parsertools.create_source_context(_assign, id, expr_l1);
			_statement_list.subnodes.Add((statement)_assign);
            _statement_list.source_context = loc;
			//block _block = new block(null, _statement_list);
			return _statement_list;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:13,代码来源:SemanticRules.cs


示例10: NewVarOrIdentifier

        public var_def_statement NewVarOrIdentifier(ident identifier, named_type_reference fptype, LexLocation loc)
        {
            var n_t_r = fptype;
			var vds = new var_def_statement();
			vds.vars = new ident_list();
			vds.vars.idents.Add(identifier);
			vds.vars_type = n_t_r;
            vds.source_context = loc;
			return vds;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:10,代码来源:SemanticRules.cs


示例11: NewVariable

        public expression NewVariable(addressed_value variable, expression var_specifiers, LexLocation loc)
        {
            if (var_specifiers is dot_node) 
			{
                var dn = (dot_node)var_specifiers;
				dn.left = variable;
			}
			else if (var_specifiers is template_param_list) 
			{
                var tpl = (template_param_list)var_specifiers;
				((dot_node)tpl.dereferencing_value).left = variable;
				parsertools.create_source_context(tpl.dereferencing_value, variable, tpl.dereferencing_value);
			}
			else if (var_specifiers is dereference) 
			{
				((dereference)var_specifiers).dereferencing_value = variable;
			}
			else if (var_specifiers is ident_with_templateparams) 
			{
                ((ident_with_templateparams)var_specifiers).name = (addressed_value_funcname)variable;
			}
            var_specifiers.source_context = loc;
            return var_specifiers;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:24,代码来源:SemanticRules.cs


示例12: NewVarAddress

 public get_address NewVarAddress(get_address var_address, LexLocation loc)
 {
     var nva = new get_address();
     nva.source_context = loc;
     var_address.address_of = (addressed_value)nva;
     return nva;
 }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:7,代码来源:SemanticRules.cs


示例13: NewSimplePropertyDefinition

        public simple_property NewSimplePropertyDefinition(method_name qualified_identifier, property_interface property_interface, property_accessors property_specifiers, property_array_default array_defaultproperty, LexLocation loc)
        {
            var nnspd = new simple_property(); 
			nnspd.property_name = qualified_identifier.meth_name;
			if (property_interface != null)
			{
				nnspd.parameter_list = property_interface.parameter_list;
				nnspd.property_type = property_interface.property_type;
				nnspd.index_expression = property_interface.index_expression;
			}
			if (property_specifiers != null) 
                nnspd.accessors = property_specifiers;
			if (array_defaultproperty != null) 
                nnspd.array_default = array_defaultproperty;
			nnspd.source_context = loc;
            return nnspd;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:17,代码来源:SemanticRules.cs


示例14: NewClassOrInterfaceKeyword

        public token_info NewClassOrInterfaceKeyword(token_info tktemp, string text, LexLocation loc)
        {
            var ncoik = tktemp;
			ncoik.text = text;
			ncoik.source_context = loc;
            return ncoik;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:7,代码来源:SemanticRules.cs


示例15: LexLocationToTextPoint

 /// <summary>
 /// Converts a LexLocation type to TextPoint.
 /// </summary>
 /// <param name="location">LexLocation instance.</param>
 /// <param name="document">TextDocument</param>
 /// <returns>new LexLocation instance</returns>
 public static TextPoint LexLocationToTextPoint(TextDocument document, LexLocation location)
 {
     TextPoint point = new LuaTextPoint(document, location.sCol, location.sLin);
     return point;
 }
开发者ID:jda808,项目名称:NPL,代码行数:11,代码来源:LuaCodeDomHelper.cs


示例16: NewPropertyDefinition

 public declaration NewPropertyDefinition(attribute_list opt_attribute_declarations, declaration simple_property_definition, LexLocation loc)
 {
     var nnpd = simple_property_definition;
     nnpd.attributes = opt_attribute_declarations;
     nnpd.source_context = loc;
     return nnpd;
 }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:7,代码来源:SemanticRules.cs


示例17: NewWhileStmt

        public while_node NewWhileStmt(token_info tkWhile, expression expr, token_info opt_tk_do, statement stmt, LexLocation loc)
        {
            var nws = new while_node(expr, stmt, WhileCycleType.While, loc); 
			if (opt_tk_do == null)
			{
				file_position fp = expr.source_context.end_position;
				syntax_tree_node err_stn = stmt;
				if (err_stn == null)
					err_stn = expr;
                parsertools.errors.Add(new PABCNETUnexpectedToken(parsertools.CurrentFileName, StringResources.Get("TKDO"), new SourceContext(fp.line_num, fp.column_num + 1, fp.line_num, fp.column_num + 1, 0, 0), err_stn));
			}
            return nws;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:13,代码来源:SemanticRules.cs


示例18: AddCaseItem

        public case_variants AddCaseItem(case_variants case_list, syntax_tree_node case_item, LexLocation loc)
        {
            var nci = case_list;
			if (case_item is case_variant)
                nci.Add((case_variant)case_item);
            nci.source_context = loc;
            return nci;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:8,代码来源:SemanticRules.cs


示例19: NewCaseItem

        /*public procedure_definition NewProcDecl(procedure_definition proc_decl_noclass, LexLocation loc)
        {
            (proc_decl_noclass.proc_header as procedure_header).class_keyword = true;
            proc_decl_noclass.source_context = loc; 
			return proc_decl_noclass;
        }*/
        public case_variants NewCaseItem(syntax_tree_node case_item, LexLocation loc)
        {
            var nci = new case_variants(); 
			if (case_item is case_variant)
				nci.Add((case_variant)case_item);
            nci.source_context = loc;
            return nci;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:14,代码来源:SemanticRules.cs


示例20: NewPropertySpecifiersWrite

        public property_accessors NewPropertySpecifiersWrite(ident tkWrite, ident opt_identifier, property_accessors property_specifiers, LexLocation loc)
        {
            var nnpsw = property_specifiers;
			if (nnpsw == null) 
			{
				nnpsw = new property_accessors();
			}
            if (opt_identifier != null)
			    nnpsw.write_accessor = new write_accessor_name(opt_identifier,tkWrite.source_context.Merge(opt_identifier.source_context));
            else nnpsw.write_accessor = new write_accessor_name(opt_identifier,tkWrite.source_context);
			nnpsw.source_context = loc;
            return nnpsw;
        }
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:13,代码来源:SemanticRules.cs



注:本文中的LexLocation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LexSense类代码示例发布时间:2022-05-24
下一篇:
C# Levels类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap