This document contains questions asking to write C/C++ and Unix programs to perform various tasks related to parsing, validating syntax and semantics, and signal handling. It asks to write programs that validate string constants, comments, numeric constants, declarations, if/else statements, arithmetic/relational/logical expressions in C code. It also asks to write Unix programs that take file/directory paths as arguments and print file details, demonstrate fork(), signal handling, inter-process communication using pipes, and daemon processes.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100%(1)100% found this document useful (1 vote)
69 views2 pages
Csl618 CD Usp QB Final Recent
This document contains questions asking to write C/C++ and Unix programs to perform various tasks related to parsing, validating syntax and semantics, and signal handling. It asks to write programs that validate string constants, comments, numeric constants, declarations, if/else statements, arithmetic/relational/logical expressions in C code. It also asks to write Unix programs that take file/directory paths as arguments and print file details, demonstrate fork(), signal handling, inter-process communication using pipes, and daemon processes.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
M.S.
Ramaiah Institute of Technology
Department of Computer Science and Engineering Compilers & Systems Programming Laoratory!CSL"#$ %uestion &an' # a( )rite a C * C++ program to accept a C program as input and detect un!terminated string constant. ,lso report error line numers and the correcti-e actions to user. ( )rite a .ni/ system program to accept file name as command line arguments and for each command line argument print the type of the file0 access permission0 de-ice numer and si1e of the file 2hich are stored in stat structure. 3 a( )rite a C * C++ program to accept a C program and chec' for un!terminated line comment statement. ( )rite a .ni/ system program that e/ecs an interpreter file0 2hich calls another program to display the arguments that is passed in the e/ec function. 4. a( )rite a Le/ program to accept a C program and perform the follo2ing. i( Chec' for un!terminated string constant in the input C program. Report the error line numers and the correcti-e actions to user. ii( Chec' for -alid arithmetic e/pressions in the input C program. Report the errors to user. ( )rite a .ni/ system program to create a file 2ith permission """ 0 find the permission of umas' such that the original file permission after mas'ing is "550 then display the modification time and access time using utime function. 6. a( )rite a Le/ program to accept a C program and perform the follo2ing . i( Chec' for the -alid usages of numerical constants. Report the in-alid usages to user. ii( Chec' for -alid declarati-e statements. Report the in-alid statements & line numers ( )rite a .ni/ system program to read n characters and store them into the specified file and redirect the output using dup3 function. 7. a( )rite a Le/ program to accept a C program and perform the follo2ing i( Chec' for the -alid if statement. Report the errors to users. ii( Chec' for un! terminated multi line comment statement. ( )rite a .ni/ system program that ta'es a single command line argument that specifies a file descriptor and prints a description of the flags for that descriptor. " a( )rite a 8acc program to accept an arithmetic e/pression and perform the follo2ing. Chec' for -alid arithmetic e/pression. Report the errors & e-aluate the arithmetic e/pression. ( )rite a .ni/ system program to illustrate set9mp and long9mp functions :deeply nested function(. 1/4 ;. a( )rite a 8acc program to accept a declarati-e statement and perform the follo2ing. Chec' for -alidity and report the errors to users. ( )rite a .ni/ system program to a-oid 1omie state of a process y for'ing t2ice. $. a( )rite a 8acc program to accept a relational e/pression and perform the follo2ing. Chec' for the -alidity0 e-aluate the e/pression and report the errors. ( )rite a .ni/ system program to accept user name as argument and display 2hether the user is -alid user or not. If the user is -alid then register the e/it handlers and demonstrate their order of in-ocation. <. a( )rite a 8acc program to accept a logical e/pression and perform the follo2ing. Chec' for the -alidity0 e-aluate the e/pression and report the errors. ( )rite a .ni/ system program to implement ls =li command 2hich list the files in a specified directory :print 7 attriutes(. #5 . a( )rite 8acc programs for the follo2ing grammars. Chec' the -alidity of the input strings. i( SSS+ > SS?>a ii(SL@R > R L?R > id RL ( )rite a .ni/ system program to create coprocess 2hich performs concatenation of t2o strings. ## a( )rite 8acc programs for the follo2ing grammars. Chec' the -alidity of the input strings. i(DTL Tint > float LL0id > id ii(S L.L > L LL& > & &5 > # ( )rite a .ni/ system program to create client and ser-er communication0 2here message sent y the client 2ill e recei-ed y the ser-er. #3 a( )rite a 8acc program to accept arithmetic e/pression. ,ccept the data types of -ariales. Chec' the semantic -alidity of the e/pression. ( )rite a .ni/ system 2hich calls a function to initiali1e itself as a daemon process. #4 a( )rite a 8acc program to accept relational e/pression. ,ccept the data types of -ariales. Chec' the semantic -alidity of the e/pression. ( )rite a .ni/ system program to catch SIA.SR# ,BD SIA.SR3 signals. #6 a( )rite a 8acc program to accept function call statement for the follo2ing functionsC strcpy:str#0str3(0e/it:5 or #( and sDrt:num(. ,ccept the data types of arguments. Chec' the semantic -alidity of the statement. ( )rite a .ni/ system program to create a coprocess 2hich performs addition of t2o numers. 2/4