Skip to content

Instantly share code, notes, and snippets.

## arith.l
/* lex program*/
%{
/* Definition section */
#include<stdio.h>
#include "y.tab.h"
//extern int yylval;
%}
## input.txt
#define PI 3.14
#define p(y) y+y
void main(){
int a ;
int PI ;
a= PI ;
int b;
## input.txt
if id == id then id = id + 1
## RecPars.java
//S-> if exp then stm
//exp-> true | false | id op id
//op-> < | > | ==
//stm-> id = id + 1
## Input.txt
int main() {
cout << "Hello" << endl;
return 0;
}
## wordcount.l
## input.txt
int main() {
cout << "Hello" << endl;
return 0;
}
## tokenidentifier.l
## Checks for aa+b*
## Code for String_rec.java
import java.util.*;
//aa+b*
public class String_rec {
String str;
int state=0;
## Input File (input.txt)
int main() {
int a=20,65b=10;
cout << "Hello" << endl;
return 0;
}
## Input file (input.cpp)
/* Program to add two numbers using cpp
Take three variables a, b, c
Input a, b from user
add a and b to c
print c
*/
#include <bits/stdc++.h>
## Input file (input.cpp)
/* Program to add two numbers using cpp
Take three variables a, b, c
Input a, b from user
add a and b to c
print c
*/
#include <bits/stdc++.h>
## Input.cpp //for input to the numberAdder
/* Program to add two numbers using cpp
Take three variables a, b, c
Input a, b from user
add a and b to c
print c
*/
#include <bits/stdc++.h>