Community
    • Login

    Help needed for creating a new parser in functionList.xml

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 1 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Andre RenardA
      Andre Renard
      last edited by

      Hi

      I am trying to write a parser in functionList.xml for a CORBA idf file.

      The test file is (test.idl) contains:

      module Test {
      interface EntityRoot { 
      };
      /* comment 1  interface Test1 { */
      interface Entity1 : EntityRoot {	
      	void setName1 ( 
      		in string value // comment 2 setName3 (
      	) raises(ServerError);       
      	void changePosition1 (
      		in long value
      	) raises(ServerError);
      };
      interface Entity2 : EntityRoot {	
      	void setName2 ( 
      		in string value // comment 2
      	) raises(ServerError);       
      	void changePosition2 (
      		in long value
      	) raises(ServerError);
      }; };
      

      I added this line within <associationMap>:
      <association id=“corba_syntax” userDefinedLangName=“CORBA” />

      The following parser is working, giving me a list of interface, struct and enum:

      <parser 
      displayName="CORBA" 
      id="corba_syntax" 
      commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)">
      <function
      	mainExpr="(interface|struct|enum)\s+\w+\s*(:\s+\w+\s*)?\{"
      >
      	<functionName>
      		<nameExpr expr="(interface|struct|enum)\s+\w+" />
      	</functionName>
      </function>
      </parser>
      

      But this on is giving nothing but the name of the file:

      <parser 
      displayName="CORBA" 
      id="corba_syntax" 
      commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)" >
      <classRange
      	mainExpr="(interface|struct|enum)\s+\w+\s*(:\s+\w+\s*)?\{"
      	openSymbole ="\{"
      	closeSymbole="\}"
      >
      	<className>
      		<nameExpr expr="(interface|struct|enum)\s+\w+" />
      	</className>
      	<function mainExpr="\s+\w+\s*\(" >
      		<functionName>
      			<funcNameExpr expr="\w+" />
      		</functionName>
      	</function>
      </classRange>
      </parser>
      

      What am I doing wrong?
      Thanks
      Andre

      1 Reply Last reply Reply Quote 0
      • Andre RenardA
        Andre Renard
        last edited by

        I found a solution.

        <parser 
        displayName="CORBA" 
        id="corba_syntax" 
        commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)" >
        <classRange
        	mainExpr="interface\s+\w+\s*(:\s+\w+\s*)?\{"
        	openSymbole ="\{"
        	closeSymbole="\}"
        >
        	<className>
        		<nameExpr expr="interface\s+\w+" />
        	</className>
        	<function mainExpr="\w+\s+\w+\s*\(" >
        		<functionName>
        			<funcNameExpr expr="\w+\s*\(" />
        			<funcNameExpr expr="\w+" />
        		</functionName>
        	</function>
        </classRange>
        <function
        	mainExpr="(struct|enum)\s+\w+\s*(:\s+\w+\s*)?\{"
        >
        	<functionName>
        		<nameExpr expr="(struct|enum)\s+\w+" />
        	</functionName>
        </function>>
        </parser>
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors