8 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello i am back :D,
i have a prolem. I want to Delete the IPs which are in Comments.
Input
192.168.0.1
192.168.0.2
#192.168.0.3
#192.168.0.4 - when TAB or Space, delete too.
/*192.168.0.5
192.168.0.6
192.168.0.7*\
Output
192.168.0.1
192.168.0.2
My solution is sed -e... (7 Replies)
Discussion started by: eightball
7 Replies
2. Shell Programming and Scripting
I want to write a shell script which it takes as argument a java file or a c++ file (.java or .cpp).
It will check if the file is type of java or c++, else it ends with error message.
If all are ok, it will call awk that prints only the comments that the java or c++ file contains, grouping and... (5 Replies)
Discussion started by: Mark_orig
5 Replies
3. Shell Programming and Scripting
I must write a script to change all C++ like comments:
// this is a comment
to this one
/* this is a comment */
How to do it by sed? With file:
#include <cstdio>
using namespace std; //one
// two
int main() {
printf("Example"); // three
}//four
the result should be: (2 Replies)
Discussion started by: black_hawk
2 Replies
4. UNIX for Dummies Questions & Answers
How can I delete comments (lines beginning with /* and ending with */) in file?
with single command line..My suggestion is to use grep and sed! (4 Replies)
Discussion started by: aadi_uni
4 Replies
5. Shell Programming and Scripting
Delete everything comes in between /* & */.
Current File:
====================
create or replace procedure test421
is
begin
/*
---sasasas/*dsdsds
*/
dbms_output.put_line('SAURABH');
END;
To be File:
===================
create or replace procedure test421
is
begin... (10 Replies)
Discussion started by: susau_79
10 Replies
6. Shell Programming and Scripting
Anyone have a good link for documentation conventions for scripts? (4 Replies)
Discussion started by: gliesian
4 Replies
7. Programming
Hi
can anyone help me regarding the meaning of the following lint messages.
what is the use of having such lint comments in the c program.
/*lint -esym(534,cputs,fgets,cprintf) */
/*lint -efile(766,pragmas.h) */
Thanks a lot in advance. (5 Replies)
Discussion started by: axes
5 Replies
8. UNIX for Dummies Questions & Answers
It may be a no-brainer, but the answer is escaping me right now:
I'm trying to write a little script to remove all comments from .c source... I was thinking sed, but I'm not a very strong regexp user (e.g. I suck with sed).
I tried dumping the file into:
sed -e 's/\/\* * \*\///g'
and several... (1 Reply)
Discussion started by: LivinFree
1 Replies
erl_recomment(3erl) Erlang Module Definition erl_recomment(3erl)
NAME
erl_recomment - Inserting comments into abstract Erlang syntax trees.
DESCRIPTION
Inserting comments into abstract Erlang syntax trees
This module contains functions for inserting comments, described by position, indentation and text, as attachments on an abstract syntax
tree, at the correct places.
EXPORTS
quick_recomment_forms(Tree::Forms, Comments::[Comment]) -> syntaxTree()
Types Forms = syntaxTree() | [syntaxTree()]
Comment = {Line, Column, Indentation, Text}
Line = integer()
Column = integer()
Indentation = integer()
Text = [string()]
Like recomment_forms/2 , but only inserts top-level comments. Comments within function definitions or declarations ("forms") are
simply ignored.
recomment_forms(Tree::Forms, Comments::[Comment]) -> syntaxTree()
Types syntaxTree() (see module erl_syntax)
Forms = syntaxTree() | [syntaxTree()]
Comment = {Line, Column, Indentation, Text}
Line = integer()
Column = integer()
Indentation = integer()
Text = [string()]
Attaches comments to the syntax tree/trees representing a program. The given Forms should be a single syntax tree of type form_list
, or a list of syntax trees representing "program forms". The syntax trees must contain valid position information (for details, see
recomment_tree/2 ). The result is a corresponding syntax tree of type form_list in which all comments in the list Comments have been
attached at the proper places.
Assuming Forms represents a program (or any sequence of "program forms"), any comments whose first lines are not directly associated
with a specific program form will become standalone comments inserted between the neighbouring program forms. Furthermore, comments
whose column position is less than or equal to one will not be attached to a program form that begins at a conflicting line number
(this can happen with preprocessor-generated line -attributes).
If Forms is a syntax tree of some other type than form_list , the comments will be inserted directly using recomment_tree/2 , and
any comments left over from that process are added as postcomments on the result.
Entries in Comments represent multi-line comments. For each entry, Line is the line number and Column the left column of the comment
(the column of the first comment-introducing " % " character). Indentation is the number of character positions between the last
non-whitespace character before the comment (or the left margin) and the left column of the comment. Text is a list of strings rep-
resenting the consecutive comment lines in top-down order, where each string contains all characters following (but not including)
the comment-introducing " % " and up to (but not including) the terminating newline. (Cf. module erl_comment_scan .)
Evaluation exits with reason {bad_position, Pos} if the associated position information Pos of some subtree in the input does not
have a recognizable format, or with reason {bad_tree, L, C} if insertion of a comment at line L , column C , fails because the tree
structure is ill-formed.
See also: erl_comment_scan , quick_recomment_forms/2 , recomment_tree/2 .
recomment_tree(Tree::syntaxTree(), Comments::[Comment]) -> {syntaxTree(), [Comment]}
Types Comment = {Line, Column, Indentation, Text}
Line = integer()
Column = integer()
Indentation = integer()
Text = [string()]
Attaches comments to a syntax tree. The result is a pair {NewTree, Remainder} where NewTree is the given Tree where comments from
the list Comments have been attached at the proper places. Remainder is the list of entries in Comments which have not been
inserted, because their line numbers are greater than those of any node in the tree. The entries in Comments are inserted in order;
if two comments become attached to the same node, they will appear in the same order in the program text.
The nodes of the syntax tree must contain valid position information. This can be single integers, assumed to represent a line num-
ber, or 2- or 3-tuples where the first or second element is an integer, in which case the leftmost integer element is assumed to
represent the line number. Line numbers less than one are ignored (usually, the default line number for newly created nodes is
zero).
For details on the Line , Column and Indentation fields, and the behaviour in case of errors, see recomment_forms/2 .
See also: recomment_forms/2 .
AUTHORS
Richard Carlsson <richardc@it.uu.se >
syntax_tools 1.6.7 erl_recomment(3erl)