Showing posts with label program. Show all posts
Showing posts with label program. Show all posts
Thursday, September 21, 2017
Trivial Lex program to tokenize a C program
Trivial Lex program to tokenize a C program
/*
* Copyright (c) 2012-13 Jobin Raju George <jobin.rv@gmail.com>
*
* Licensed under the GNU General Public License Version 2
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* A copy of the GNU General Public License is available at
* <http://www.gnu.org/licenses/>.
*/
%{
#include <stdio.h>
%}
DIGIT [0-9]
NUMBER {DIGIT}+
REAL {DIGIT}*"."{DIGIT}+
TEXT [a-zA-Z ]+
TEXT_NUMBERS [a-zA-Z0-9]
CONDITIONALS "if"|"else"|"else if"|"switch"|"case"
KEYWORD "break"|"continue"|"goto"|"printf"|"scanf"|"sprintf"|"sscanf"|"fopen"|"fwrite"|"fread"|"fclose"|"write"|"read"|"open"|"close"|"return"|"int"|"float"|"char"|"unsigned"|"signed"|"short"|"long"|"double"
ITERATORS "for"|"while"|"do"
PREPROCESSOR "#"|"#line"|"#undef"|"#error"|"#elif"|"#else"|"#endif"|"#if"|"#define"|"#include"|"#pragma"|"#ifndef"|"#ifdef"
DELIMITER [; : ()"]
IDENTIFIER [a-zA-Z]{TEXT_NUMBERS}*|[a-zA-Z]{TEXT_NUMBERS}*[[{NUMBER}+]]
NON_IDENTIFIER {NUMBER}+[A-Za-z]+
FORMAT_SPECIFIER "%"{TEXT_NUMBERS}+
FILE "<"{IDENTIFIER}.h">"
COMMENT "/*"[a-zA-Z0-9 ;.~!@#$%^&*()_+=<>?:"{}]*"*/"
AOPERATOR "+"|"-"|"*"|"/"|"="
BLOCK_BEGINS "{"
BLOCK_ENDS "}"
UNARY "++"|"--"
LOPERATOR "&"|"|"|"&&"|"~"|"||"|">"|"<"|">="|"<="|"=="
FUNCTION {IDENTIFIER}+"("{DELIMITER}*{TEXT}{TEXT_NUMBERS}*{DELIMITER}*")"
%%
{CONDITIONALS} { printf("%s is a conditional ", yytext); }
{ITERATORS} { printf("%s is an iterator ", yytext); }
{DIGIT} { printf("%s is a digit ", yytext); }
{NUMBER} { printf("%s is a number ", yytext); }
{REAL} { printf("%s is a real number ", yytext); }
{PREPROCESSOR} { printf("%s is a preprocessor directive ", yytext); }
{DELIMITER} { printf("%s is a delimiter ", yytext); }
{KEYWORD} { printf("%s is a keyword ", yytext); }
{NON_IDENTIFIER} {printf("Could not process %s", yytext); }
{IDENTIFIER} { printf("%s is an identifier ", yytext); }
{COMMENT} { printf("%s is a comment ", yytext); }
{AOPERATOR} { printf("%s is a mathematical operator ", yytext); }
{LOPERATOR} { printf("%s is a logical operator ", yytext); }
{BLOCK_BEGINS} { printf("Block begins ", yytext); }
{BLOCK_ENDS} { printf("Block ends ", yytext); }
{FILE} { printf("%s is a file ", yytext); }
{UNARY} { printf("%s is a unary operator ", yytext); }
{FUNCTION} { printf("%s is a function ", yytext); }
{FORMAT_SPECIFIER} {printf("%s is a format specifier ", yytext); }
%%
int main(int argc, char *argv[]) {
yylex();
return 0;
}
To compile this program, type the following commands:
lex filename.l
cc lex.yy.c -ll
./a.out
cc lex.yy.c -ll
./a.out
download file now
Sunday, September 10, 2017
Unable to load Deep Freeze Configuration Login Program will not be available
Unable to load Deep Freeze Configuration Login Program will not be available
Problem: No Deep Freeze Icon in Taskbar


To Solve This Issue Disable All Faronics Deep Freeze Services
You can done this by simply typing the command services.msc in the run dialog box. Once you are in the services window, locate the service name DFserv and right click on it and select properties (refer to image below).

After clicking properties, stop and disable the service. Refer to the image below for instructions. Note: Restart is needed for changes to take effect on your system.

After restarting, at this point you no longer have any Deep Freeze service or application running at the background of your system. Also the system Deep Freeze Icon should be gone. You are still able re-enable Deep Freeze by reversing the whole process. Note: You can now uninstall deep freeze and re install again.
More Tags: Angry Bird, Blogger, Fate , Plants Vs Zombie, Special Force, Point Blank, Ai Maps, Deep Freeze UnFreezer, Ninja Saga, Deep Freeze, Samsung SGH, Guitar Pro, USB XP Install, Yahoo 443 Problem, Turtle Odyssey, GTA San-Andreas, PlayStation, Tips Tweaks Tricks, HTML, Facebook, Animated JPG, Counter-Strike, USB Windows Format, Screensaver, USB Security.
download file now
Subscribe to:
Posts (Atom)